Skip to content

Conversation

@ryderstorm
Copy link
Contributor

@ryderstorm ryderstorm commented Nov 25, 2025

Why?

This PR adds support for Amazon Q as a new AI coding assistant and improves test maintainability by removing hardcoded agent expectations that required manual updates when adding new agents.

Evidence: The branch name feat/support-amazon-q-in-vs-code indicates the primary goal. Commits d0c457d and 30c70b9 implement the feature and test refactoring respectively.

What Changed?

Added Amazon Q agent configuration and refactored tests to use structural validation instead of hardcoded expectations, making it easier to add new agents in the future.

Key Changes:

  • Amazon Q support: Added agent configuration with command directory ~/.aws/amazonq/prompts and detection via .aws/amazonq
  • Test refactoring: Replaced EXPECTED_AGENTS dictionary with structural invariant tests that automatically validate new agents
  • CLI test helper: Extracted _get_cli_output() function to reduce code duplication in test assertions
  • AGENTS.md: Added minimal agent instructions file for AI coding assistants working on this repo
  • Documentation: Updated README with Amazon Q and OpenCode CLI in supported agents list

Files Modified: slash_commands/config.py, tests/test_config.py, tests/test_cli.py, tests/test_detection.py, README.md, AGENTS.md

Additional Notes

  • Breaking Changes: None
  • Performance Implications: None
  • Security Considerations: None
  • Testing Strategy: Existing unit tests updated; structural validation ensures new agents are automatically tested
  • Dependencies: No new dependencies
  • Configuration Changes: None required
  • Known Limitations: None identified
  • Related Issues: N/A

Review Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated for new functionality
  • Documentation updated if needed
  • No breaking changes (or properly documented with migration path)
  • Performance impact considered
  • Security implications reviewed
  • Dependencies reviewed and approved

Summary by CodeRabbit

  • New Features

    • Added support for Amazon Q and OpenCode CLI as new supported AI tools.
  • Documentation

    • Updated documentation to reflect newly supported AI tools.
    • Added comprehensive developer guidelines covering project conventions and execution workflows.
  • Tests

    • Enhanced test coverage for agent configuration, detection, and CLI output validation.
    • Improved test infrastructure for cross-environment compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

Used the 🗡️ (dagger) emoji for a context marker because it is
relatively unique, still connected to the repo (slash in the name),
and shouldn't conflict with other context markers.
… validation

Remove EXPECTED_AGENTS dictionary that required manual updates when adding
new agents. Replace with tests that validate structural invariants:

- Command directories must end with /commands, /prompts, /global_workflows, or /command
- File extensions must start with a dot
- Detection dirs must be tuples of hidden directories
- Command formats must be MARKDOWN or TOML

This makes tests more maintainable and automatically validates new agents.
Add _get_cli_output() helper to consolidate repeated stderr/stdout
extraction logic across test cases. This reduces code duplication and
makes tests more consistent in how they handle CLI output.
Add Amazon Q agent configuration:
- Command directory: ~/.aws/amazonq/prompts
- Detection directory: .aws/amazonq (specific to avoid false positives)
- Markdown format with .md extension

Update documentation to include Amazon Q in the
supported agents list.

Update test_detection to dynamically test all supported agents instead
of a hardcoded subset.
@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

This PR adds Amazon Q as a supported AI agent, updates documentation to include Amazon Q and OpenCode CLI, refactors test output handling for robustness, and improves test coverage by making agent detection dynamic rather than hardcoded.

Changes

Cohort / File(s) Summary
Documentation
AGENTS.md, README.md
Added new AGENTS.md with project execution commands, testing workflows, and conventions. Updated README.md with OpenCode CLI and Amazon Q tooling documentation.
Agent Configuration
slash_commands/config.py
Introduced Amazon Q agent entry to _SUPPORTED_AGENT_DATA with Markdown format, .aws/amazonq/prompts prompt directory, and .aws/amazonq discovery path.
Test Infrastructure
tests/test_cli.py
Added _get_cli_output() helper function to normalize CLI output (combines stdout/stderr, lowercases) for environment-agnostic test assertions.
Test Coverage Updates
tests/test_cli.py, tests/test_config.py, tests/test_detection.py
Refactored test assertions to use centralized output handler; reworked agent validation to check structural invariants instead of hardcoded mappings; converted hardcoded agent keys to dynamic iteration over SUPPORTED_AGENTS.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Test refactoring patterns: Verify that _get_cli_output() consistently handles all edge cases across different environments (stdout/stderr availability).
  • Structural validation changes: Review test_config.py logic for the new structural invariant checks and ensure suffixes/extensions are correctly validated.
  • Dynamic agent detection: Confirm that deriving agent keys dynamically from SUPPORTED_AGENTS in test_detection.py correctly covers all cases without brittleness.
  • Amazon Q integration: Cross-check config.py entry against README.md and AGENTS.md for consistency (format, paths, naming).

Poem

🐰 A whisker-twitch of config delight,
Amazon Q joins agents in flight,
Tests now robust, no hardcoded chains,
Dynamic detection flows through our veins,
Documentation blooms, conventions shine bright! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding Amazon Q support and improving test maintainability through refactoring.
Description check ✅ Passed The description comprehensively covers all required template sections with clear motivation, detailed change summary, testing strategy, and thorough additional notes.
Docstring Coverage ✅ Passed Docstring coverage is 81.82% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/support-amazon-q-in-vs-code

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 177b169 and 760e7f3.

📒 Files selected for processing (6)
  • AGENTS.md (1 hunks)
  • README.md (1 hunks)
  • slash_commands/config.py (1 hunks)
  • tests/test_cli.py (15 hunks)
  • tests/test_config.py (2 hunks)
  • tests/test_detection.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/test_config.py (2)
tests/test_detection.py (1)
  • supported_agents_by_key (14-15)
slash_commands/config.py (2)
  • AgentConfig (18-31)
  • CommandFormat (10-14)
🔇 Additional comments (10)
README.md (1)

192-193: LGTM! Clear documentation additions.

The new tool entries are accurate and consistent with the agent configurations in slash_commands/config.py. The paths match the configured command directories.

AGENTS.md (1)

1-31: Helpful project documentation.

This file provides clear guidance on required commands and critical development rules. The emphasis on Docker-isolated integration tests is particularly important for preventing unintended user file overwrites.

tests/test_detection.py (1)

27-28: Excellent refactoring for maintainability.

Deriving agent keys dynamically from SUPPORTED_AGENTS ensures that new agents like Amazon Q are automatically covered by detection tests without manual updates.

tests/test_cli.py (3)

15-21: Robust CLI output helper.

The function handles environment-specific differences in stderr/stdout access gracefully, making tests more reliable across different test environments.


93-93: Good test coverage for Amazon Q.

The assertion ensures the new agent appears in CLI output, consistent with testing for other agents.


260-260: Consistent refactoring with the new helper.

All CLI output assertions now use _get_cli_output(), improving consistency and robustness across the test suite.

Also applies to: 308-310, 567-567, 615-615, 646-646, 955-955, 957-959, 988-989, 1034-1034, 1108-1109, 1133-1135, 1153-1155, 1173-1175, 1200-1201

tests/test_config.py (3)

54-78: Excellent refactoring to structural invariants.

This approach validates essential properties rather than exact values, making the tests more maintainable. New agents like Amazon Q are automatically validated without test modifications.


81-89: More flexible format validation.

The refactored validation ensures all agents use supported formats without constraining the specific distribution, accommodating future agent additions more gracefully.


113-115: Well-documented special case for Amazon Q.

The comment clearly explains why .aws/amazonq is used for detection rather than the more general .aws directory, preventing false positives.

slash_commands/config.py (1)

70-77: Amazon Q configuration verified and accurate.

The paths match AWS documentation and are confirmed in both the project README (line 193: "~/.aws/amazonq/prompts") and validated by the existing test suite (tests/test_config.py, lines 114-115). The scoped detection path ".aws/amazonq" appropriately avoids false positives from the broader ".aws" directory.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ryderstorm ryderstorm merged commit 95022ff into main Nov 26, 2025
10 checks passed
@ryderstorm ryderstorm deleted the feat/support-amazon-q-in-vs-code branch November 26, 2025 19:36
@coderabbitai coderabbitai bot mentioned this pull request Jan 6, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants