Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Aug 25, 2025

Description

This PR updates the built-in /init slash command to emphasize that it should only include non-obvious information discovered by reading files, making the generated AGENTS.md documentation more valuable and concise.

Changes Made

1. Added CRITICAL Section

  • Clear explanation of what qualifies as non-obvious information
  • Emphasis on project-specific patterns discovered by reading files
  • Focus on essential gotchas and hidden requirements

2. Updated Main File Output Structure

  • Explicitly excludes obvious information like:
    • Standard npm/yarn commands visible in package.json
    • Framework defaults (e.g., "React uses JSX")
    • Common patterns (e.g., "tests go in tests folders")
    • Information derivable from file extensions or directory names

3. Transformed All Mode-Specific Examples

Code Mode now emphasizes:

  • safeWriteJson() requirement (prevents corruption)
  • Mandatory API retry mechanism (not optional as it appears)
  • Database queries MUST use query builder (raw SQL will fail)

Debug Mode now emphasizes:

  • Webview dev tools accessed via Command Palette (not F12)
  • IPC messages fail silently without try/catch
  • Extension logs in "Extension Host" output channel

Ask Mode now emphasizes:

  • "src/" contains VSCode extension (counterintuitive)
  • Provider examples are canonical reference (docs outdated)
  • Two separate i18n systems (root vs webview-ui)

Architect Mode now emphasizes:

  • Providers MUST be stateless (hidden caching layer)
  • Database migrations are forward-only by design
  • Monorepo has intentional circular dependency

4. Updated Quality Criteria

  • Every line should prevent a potential mistake or confusion
  • Test: "Would an experienced developer be surprised by this information?"

Testing

  • All existing tests pass
  • Command generates more concise, valuable documentation
  • Focus is exclusively on non-obvious, project-specific information

Impact

This change will help AI assistants generate more valuable AGENTS.md files by focusing only on the information that truly matters - the non-obvious, project-specific knowledge that can't be guessed from standard practices.


Important

Refines /init command to focus on non-obvious, project-specific information for AGENTS.md, excluding standard practices.

  • Behavior:
    • Updates /init command in built-in-commands.ts to focus on non-obvious, project-specific information for AGENTS.md.
    • Excludes obvious information like standard npm/yarn commands, framework defaults, and common patterns.
    • Emphasizes project-specific patterns, gotchas, and hidden requirements.
  • Testing:
    • Updates tests in built-in-commands.spec.ts to check for non-obvious content in the init command.
    • Ensures init command content includes "non-obvious" and "discovered by reading files".
  • Documentation:
    • Updates AGENTS.md creation guidelines to focus on non-obvious information only.
    • Specifies paths for mode-specific AGENTS.md files in the project root.

This description was created by Ellipsis for 8bcae24. You can customize this summary. It will automatically update as commits are pushed.

- Emphasize that only non-obvious information discovered by reading files should be included
- Update all mode-specific examples to show truly non-obvious rules
- Add CRITICAL section explaining what qualifies as non-obvious
- Exclude standard patterns and framework defaults
- Focus on gotchas, hidden requirements, and counterintuitive patterns
Copilot AI review requested due to automatic review settings August 25, 2025 21:55
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates the built-in /init slash command to generate more focused and valuable AGENTS.md documentation by emphasizing only non-obvious, project-specific information discovered through file analysis.

  • Adds explicit criteria for what constitutes "non-obvious" information worth documenting
  • Updates output structure to exclude obvious framework defaults and standard practices
  • Transforms all mode-specific examples to focus on hidden gotchas and counterintuitive patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dosubot dosubot bot added the enhancement New feature or request label Aug 25, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 25, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this valuable improvement! The focus on non-obvious, project-specific information will significantly enhance the quality of generated AGENTS.md files. I've reviewed the changes and have some suggestions to further improve clarity and consistency.

5. Document critical patterns
- Project-specific utilities
- Non-standard approaches
- Project-specific utilities (that you discovered by reading code)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition of the CRITICAL section! The clarity on what constitutes non-obvious information is excellent. However, I noticed the terminology switches between "Discovered by reading files" (line 28) and "discovered by reading code" (line 59). Should we standardize on one phrase for consistency?

- Database queries must use the query builder in packages/evals/src/db/queries/
- Always use safeWriteJson() from src/utils/ instead of JSON.stringify for file writes
- Test coverage required for all new features in src/ and webview-ui/
# Project Coding Rules (Non-Obvious Only)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples are very helpful! Quick question: Are these actual requirements in the Roo-Code codebase (like safeWriteJson() being mandatory), or are they hypothetical examples? If hypothetical, should we add a note clarifying they're illustrative?

- Focus on gotchas, hidden requirements, and counterintuitive patterns
- Include specific file paths when referencing custom utilities
- Be extremely concise - if it's obvious, don't include it
- Every line should prevent a potential mistake or confusion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quality criteria is excellent, especially the test question. Consider adding guidance for edge cases - what should AI assistants do when unsure if something is "non-obvious"? Perhaps: "When in doubt, err on the side of inclusion if it could prevent errors"?

…iles

- Check for existing AGENTS.md in root directory
- Check for existing AGENTS.md in all .roo/rules-*/ directories
- Read and improve existing files rather than replacing them
- Update discovery phase to explicitly look for these files
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 25, 2025
…d files

- Consolidate all AGENTS.md path checking into step 1 with CRITICAL emphasis
- Add explicit instructions for deep dive improvement of existing files
- Remove redundant mentions throughout the workflow
- Emphasize iterating and enhancing existing files, not just appending
- Add clear guidance on cleaning up outdated info and reorganizing
- Make discovery phase the single source of truth for file checking
- Add explicit instructions to DELETE obvious information first
- Emphasize that files should get SHORTER, not longer
- Use stronger language: CRITICALLY EVALUATE, AGGRESSIVELY DELETE
- Make clear that standard practices must be removed even if previously included
- Add success metric: files should be more concise and valuable
- Goal is to fix the tendency to just append instead of clean up
CRITICAL FIX: Paths were being interpreted as absolute, causing .roo to be created at system root

- Clarify all paths are relative to PROJECT/WORKSPACE root
- Add explicit warnings that .roo must be in project root, not system root
- Update example to show proper project structure
- Add IMPORTANT notes throughout emphasizing relative paths
- Fix prevents accidental creation of /.roo at system level
- Replace 'mode-specific rule directories' with 'non-obvious'
- Replace 'analysis_workflow' with 'discovered by reading files'
- Tests now align with the new focus on non-obvious discoveries
@hannesrudolph hannesrudolph merged commit 0cfd314 into main Aug 26, 2025
9 of 10 checks passed
@hannesrudolph hannesrudolph deleted the feat/init-command-non-obvious-only branch August 26, 2025 03:01
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 26, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants