aws / aws/amazon-q-developer-cli

Feature - Automated and Context-Aware Rule File Management

Aperta
#2,603 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia esaminando la gestione manuale attuale dei file rules.md e la convenzione AGENT.md descritta nell’issue; non vengono indicati file di implementazione né test. Il lavoro è completato quando i file delle regole vengono individuati dalla directory di lavoro fino alla radice del progetto, combinati gerarchicamente e vengono ignorate le regole delle directory non correlate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
ai, cli
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.