mchades opened a new issue, #9789:
URL: https://github.com/apache/gravitino/issues/9789

   ### What would you like to be improved?
   
   Currently, the `AGENTS.md` and `.github/copilot-instructions.md` files in 
the repository contain valuable instructions for AI assistants, but the content 
is overly verbose and redundant.
   
   As these files are injected into the LLM's system prompt (context window) 
during code generation, excessive verbosity has negative impacts:
   
   1. **Context Window Waste:** Verbose instructions consume valuable tokens, 
reducing the context available for actual project code and increasing latency.
   2. **Decreased LLM Performance:** According to [OpenAI's Prompt Engineering 
Guide](https://platform.openai.com/docs/guides/prompt-engineering) and [GitHub 
Copilot Custom Instructions 
Docs](https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot),
 LLMs perform best with concise, direct, and imperative instructions. Lengthy 
prose can lead to the "Lost in the Middle" phenomenon where the AI ignores 
crucial rules.
   3. **Missing Coding Standards:** Some critical Gravitino coding conventions 
are currently missing, such as the preference for Java imports over Fully 
Qualified Class Names (FQN).
   
   ### How should we improve?
   
   I propose refactoring these two files to optimize them for LLM parsing. The 
improvements should include:
   
   1. **Streamline the language:** Convert paragraph-style prose into concise, 
imperative bullet points (e.g., "Do X" instead of "It is recommended that you 
should do X").
   2. **Deduplication:** Ensure `AGENTS.md` (which seems to target general AI 
agents like AutoGPT/Cursor) and `copilot-instructions.md` (specifically for 
GitHub Copilot) share a unified core rule set without unnecessary overlap.
   3. **Add explicit coding rules:** Specifically, add a rule to avoid using 
fully qualified class names in the code.
   * *Example addition:* "Java Coding Style: Always use standard `import` 
statements at the top of the file. DO NOT use fully qualified class names 
(e.g., use `Table` instead of `org.apache.gravitino.rel.Table`) inside methods."
   
   
   
   **Example of optimization:**
   *Before:*
   
   > "When you are writing Java code, please make sure that you follow the 
Google Java Style Guide and try to make the code as clean as possible."
   
   *After:*
   
   > "- Follow Google Java Style Guide.
   > * Prioritize code readability and use standard imports over Fully 
Qualified Class Names."
   > 
   > 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to