Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 31, 2026

Summary

  • Adds instructions config to opencode.json via generate-opencode-agents.sh
  • OpenCode now auto-loads ~/.aidevops/agents/AGENTS.md in every session
  • Fixes unreliable "read this file" instruction in global AGENTS.md stub

Problem

The global ~/.config/opencode/AGENTS.md contained:

Add ~/.aidevops/agents/AGENTS.md to context for AI DevOps capabilities.

This relied on the LLM using its Read tool to follow the instruction, which was unreliable.

Solution

OpenCode's instructions field in opencode.json automatically includes specified files in every session context. Now both work together:

File Purpose
instructions: [~/.aidevops/agents/AGENTS.md] Full framework docs (auto-loaded)
~/.config/opencode/AGENTS.md Version check + pre-edit instructions

Testing

  • setup.sh runs successfully
  • opencode.json contains "instructions": ["/Users/.../AGENTS.md"]
  • ShellCheck passes

Ref

Summary by CodeRabbit

  • Chores
    • Automatically load global instructions from user configuration at session start, with existence checks and clear user messages.
    • Startup and shutdown summaries now display Instructions and Global Rules distinctly and reflect the new loading behavior.

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

OpenCode's 'instructions' field in opencode.json automatically includes
specified files in every session context. This ensures the full aidevops
framework documentation is available without relying on the LLM to follow
'read this file' instructions in the global AGENTS.md stub.

Previously, ~/.config/opencode/AGENTS.md contained a short stub telling
the LLM to read ~/.aidevops/agents/AGENTS.md, but OpenCode doesn't
automatically follow file references - the LLM would need to use its
Read tool, which was unreliable.

Now:
- instructions: [~/.aidevops/agents/AGENTS.md] auto-loads full framework docs
- Global AGENTS.md still provides version check + pre-edit instructions
- Both work together for complete aidevops integration

Ref: https://opencode.ai/docs/rules/#using-opencodejson
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the OpenCode environment by automating the inclusion of critical aidevops framework documentation into every session. By leveraging OpenCode's instructions configuration, it ensures that the language model always has access to the necessary context, thereby improving the reliability and consistency of agent interactions without relying on the model's ability to interpret and act on manual file-reading instructions.

Highlights

  • Automated Context Loading: OpenCode now automatically loads the ~/.aidevops/agents/AGENTS.md file into every session's context by utilizing the instructions configuration in opencode.json.
  • Improved Reliability: This change resolves the issue of the LLM unreliably following a 'read this file' instruction previously present in the global AGENTS.md stub, ensuring the full framework documentation is always available.
  • Configuration Script Update: The generate-opencode-agents.sh script has been updated to include the new instructions configuration, streamlining the setup process.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

Walkthrough

A shell script change configures the framework to auto-load ~/.aidevops/agents/AGENTS.md via config['instructions'] and updates startup/shutdown summary output to show separate "Instructions" and "Global rules" lines instead of the prior AGENTS.md line.

Changes

Cohort / File(s) Summary
Agent Configuration Script
.agent/scripts/generate-opencode-agents.sh
Added config['instructions'] pointing to ~/.aidevops/agents/AGENTS.md with existence checks and messages. Replaced previous single AGENTS.md summary line with two lines: "Instructions" (path) and "Global rules" (path). Startup/shutdown messaging adjusted accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • marcusquinn/aidevops PR 228 — related changes to generate-opencode-agents.sh for agent source configuration and symlink handling
  • marcusquinn/aidevops PR 5 — adds OpenCode integration documentation to .agent/AGENTS.md
  • marcusquinn/aidevops PR 26 — updates session-management content within AGENTS.md

Poem

🌱 A tiny script wakes with light,
Instructions found, now shining bright,
Two lines whisper what to do,
Global rules and paths in view,
Automation hums — the agents write.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: auto-loading aidevops AGENTS.md via the instructions config mechanism in opencode.json.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feature/opencode-instructions-config

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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves OpenCode configuration by automatically loading the AGENTS.md file, which makes the AI DevOps framework context reliably available. The change modifies generate-opencode-agents.sh to add the file path to the instructions field in opencode.json. My review includes a suggestion to make this change more robust by checking if the file exists before adding it to the configuration.

Comment on lines 442 to 445
config['instructions'] = [
os.path.expanduser("~/.aidevops/agents/AGENTS.md")
]
print(" Added instructions: ~/.aidevops/agents/AGENTS.md (auto-loaded every session)")

Choose a reason for hiding this comment

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

medium

The script currently assumes ~/.aidevops/agents/AGENTS.md exists. If it doesn't (e.g., if setup.sh hasn't been run), a path to a non-existent file will be added to opencode.json, which could cause issues in OpenCode. It would be more robust to check for the file's existence before adding it to the instructions. This prevents potential errors and provides a helpful warning to the user if the file is missing.

Note that with this change, the summary message at the end of the script might be slightly misleading if the file is not found. A more advanced solution could involve passing state from the python script to the shell script to conditionally print the 'Instructions' line.

Suggested change
config['instructions'] = [
os.path.expanduser("~/.aidevops/agents/AGENTS.md")
]
print(" Added instructions: ~/.aidevops/agents/AGENTS.md (auto-loaded every session)")
instructions_path = os.path.expanduser("~/.aidevops/agents/AGENTS.md")
if os.path.exists(instructions_path):
config['instructions'] = [instructions_path]
print(" Added instructions: ~/.aidevops/agents/AGENTS.md (auto-loaded every session)")
else:
print(" [!] Warning: ~/.aidevops/agents/AGENTS.md not found. Skipping instructions. Run ./setup.sh to create it.")

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 408 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Jan 31 19:25:17 UTC 2026: Code review monitoring started
Sat Jan 31 19:25:17 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 408
Sat Jan 31 19:25:18 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Jan 31 19:25:20 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 408
  • VULNERABILITIES: 0

Generated on: Sat Jan 31 19:26:47 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Address Gemini Code Assist review feedback - avoid adding non-existent
file path to opencode.json if setup.sh hasn't been run yet.
@augmentcode
Copy link

augmentcode bot commented Jan 31, 2026

🤖 Augment PR Summary

Summary: Ensures the aidevops framework docs are reliably present in OpenCode sessions by adding an instructions entry to the generated opencode.json.

Changes:

  • Update generate-opencode-agents.sh to write instructions: [~/.aidevops/agents/AGENTS.md] into ~/.config/opencode/opencode.json
  • Adjust the script’s completion output to reflect the new auto-loaded instructions + global rules split

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

# This ensures the full aidevops framework docs are available without
# relying on the LLM to follow "read this file" instructions.
# See: https://opencode.ai/docs/rules/#using-opencodejson
config['instructions'] = [
Copy link

Choose a reason for hiding this comment

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

config['instructions'] is set unconditionally here, which will overwrite any existing user-configured instructions already present in opencode.json (despite the log message saying it was “Added”). Consider whether clobbering prior entries is intended, since it could unexpectedly remove other instruction files a user relies on.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

echo " Subagents: $subagent_count auto-discovered from subfolders (@mentionable)"
echo " AGENTS.md: ~/.config/opencode/AGENTS.md"
echo " Instructions: ~/.aidevops/agents/AGENTS.md (auto-loaded every session)"
echo " Global rules: ~/.config/opencode/AGENTS.md (version check + pre-edit)"
Copy link

Choose a reason for hiding this comment

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

This summary line describes ~/.config/opencode/AGENTS.md as “version check + pre-edit”, but the script still writes a top-line instruction to load ~/.aidevops/agents/AGENTS.md, which is now redundant/confusing with the new instructions auto-load behavior.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@sonarqubecloud
Copy link

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 408 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Jan 31 19:28:14 UTC 2026: Code review monitoring started
Sat Jan 31 19:28:15 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 408
Sat Jan 31 19:28:15 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Sat Jan 31 19:28:17 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 408
  • VULNERABILITIES: 0

Generated on: Sat Jan 31 19:29:31 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit 04395e2 into main Jan 31, 2026
12 of 13 checks passed
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.

1 participant