From 8bef570f9eaa42509939a6aabf7b1083c7819f9d Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Wed, 7 Jan 2026 20:32:49 +0000 Subject: [PATCH 1/4] docs: add MCP token optimization pointer to AGENTS.md - Add one-line reference to build-agent.md for MCP optimization patterns - Update TODO.md with task tracking for optimization work - Detailed guidance already exists in tools/build-agent/build-agent.md:264-299 --- .agent/AGENTS.md | 2 ++ TODO.md | 50 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/.agent/AGENTS.md b/.agent/AGENTS.md index 4388945d..fde70b73 100644 --- a/.agent/AGENTS.md +++ b/.agent/AGENTS.md @@ -381,6 +381,8 @@ aidevops supports multiple discovery methods: **Note**: Tool-specific files (`.cursorrules`, `.windsurfrules`, etc.) are not tracked in git. Create symlinks locally if needed. +**MCP Token Optimization**: Disable heavy MCPs globally, enable per-agent. See `tools/build-agent/build-agent.md` for patterns. + ## Development Workflows For versioning, releases, and git operations: diff --git a/TODO.md b/TODO.md index 6d66d8d2..1b805f24 100644 --- a/TODO.md +++ b/TODO.md @@ -68,8 +68,32 @@ Tasks with no open blockers - ready to work on. Use `/ready` to refresh this lis - [ ] t018 Enhance Plan+ and Build+ with OpenCode's Latest Features #plan → [todo/PLANS.md#enhance-plan-and-build-with-opencodes-latest-features] ~3h (ai:1.5h test:1h read:30m) logged:2025-12-21 - [ ] t020 Git Issues Bi-directional Sync (GitHub, GitLab, Gitea) #plan #git #sync ~3d (ai:1.5d test:1d read:0.5d) logged:2025-12-21 - [ ] t021 Auto-mark tasks complete from commit messages in release #workflow #automation ~2h (ai:1h test:30m read:30m) logged:2025-12-22 - - From de2d71e0c2fd549818926e39a1e5125354fa401e Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Wed, 7 Jan 2026 20:40:03 +0000 Subject: [PATCH 2/4] fix: deploy VERSION file to ~/.aidevops/agents/ - setup.sh now copies VERSION from repo root to deployed agents - Fixes read-only agents (Plan+) reading wrong version - Also updated ~/.config/opencode/AGENTS.md to specify full path --- setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.sh b/setup.sh index 86f9a966..4c2baaea 100755 --- a/setup.sh +++ b/setup.sh @@ -959,6 +959,11 @@ deploy_aidevops_agents() { print_info "Deployed $agent_count agent files and $script_count scripts" + # Copy VERSION file from repo root to deployed agents + if [[ -f "$script_dir/VERSION" ]]; then + cp "$script_dir/VERSION" "$target_dir/VERSION" + fi + # Inject extracted OpenCode plan-reminder into Plan+ if available local plan_reminder="$HOME/.aidevops/cache/opencode-prompts/plan-reminder.txt" local plan_plus="$target_dir/plan-plus.md" From 249b93b25799b6f866bfbe2c92908d4de3fae50f Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Wed, 7 Jan 2026 20:44:06 +0000 Subject: [PATCH 3/4] fix: read-only agents must use Read tool for VERSION - Explicit instruction to use Read tool on ~/.aidevops/agents/VERSION - Prevents hallucinated version numbers - Also respond to user's actual message after greeting - Simplified config AGENTS.md, details in main agents file --- .agent/scripts/generate-opencode-agents.sh | 35 +++++++--------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/.agent/scripts/generate-opencode-agents.sh b/.agent/scripts/generate-opencode-agents.sh index db9c4955..d5907e08 100755 --- a/.agent/scripts/generate-opencode-agents.sh +++ b/.agent/scripts/generate-opencode-agents.sh @@ -41,30 +41,17 @@ Add ~/.aidevops/agents/AGENTS.md to context for AI DevOps capabilities. ## aidevops Framework Status -**CRITICAL - DO THIS FIRST**: Before responding to ANY user message in a new conversation: -1. Run this command using the Bash tool: `bash ~/.aidevops/agents/scripts/aidevops-update-check.sh` -2. Greet with exactly this format (with line breaks): - "Hi! - - We're running https://aidevops.sh v{version}. - - What would you like to work on?" - -If the output contains `UPDATE_AVAILABLE|current|latest`, inform the user: "An aidevops update is available (current → latest). Run `aidevops update` to update, then restart OpenCode." - -## MANDATORY: Pre-Edit Git Check - -**BEFORE any Edit/Write tool call**, run: -```bash -~/.aidevops/agents/scripts/pre-edit-check.sh -``` - -If output shows "STOP - ON PROTECTED BRANCH": Do NOT proceed. Ask user to choose: -1. Create suggested branch (recommended) -2. Use different branch name -3. Stay on main (not recommended) - -After creating branch, call `session-rename_sync_branch` tool. +**On conversation start**: +1. If Bash tool available: Run `bash ~/.aidevops/agents/scripts/aidevops-update-check.sh` +2. If Bash unavailable: Use Read tool on `~/.aidevops/agents/VERSION` to get version +3. Greet with: "Hi!\n\nWe're running https://aidevops.sh v{version}.\n\nWhat would you like to work on?" +4. Then respond to the user's actual message + +If update check output contains `UPDATE_AVAILABLE|current|latest`, inform user to run `aidevops update`. + +## Pre-Edit Git Check + +Only for agents with Edit/Write/Bash tools. See ~/.aidevops/agents/AGENTS.md for workflow. EOF echo -e " ${GREEN}✓${NC} Updated AGENTS.md with version check" From 5fede688fe1ce0d37da1801713b58f60057763bd Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Wed, 7 Jan 2026 21:23:30 +0000 Subject: [PATCH 4/4] fix: address CodeRabbit feedback - Add error handling for VERSION file copy in setup.sh - Fix UPDATE_AVAILABLE pattern description (use actual version format) - Add warning if VERSION file not found --- .agent/scripts/generate-opencode-agents.sh | 2 +- setup.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.agent/scripts/generate-opencode-agents.sh b/.agent/scripts/generate-opencode-agents.sh index d5907e08..5acac11e 100755 --- a/.agent/scripts/generate-opencode-agents.sh +++ b/.agent/scripts/generate-opencode-agents.sh @@ -47,7 +47,7 @@ Add ~/.aidevops/agents/AGENTS.md to context for AI DevOps capabilities. 3. Greet with: "Hi!\n\nWe're running https://aidevops.sh v{version}.\n\nWhat would you like to work on?" 4. Then respond to the user's actual message -If update check output contains `UPDATE_AVAILABLE|current|latest`, inform user to run `aidevops update`. +If update check output starts with `UPDATE_AVAILABLE|` (e.g., `UPDATE_AVAILABLE|2.41.1|2.41.2`), inform user: "Update available (current → latest). Run `aidevops update` to update." ## Pre-Edit Git Check diff --git a/setup.sh b/setup.sh index 4c2baaea..3b926eee 100755 --- a/setup.sh +++ b/setup.sh @@ -961,7 +961,13 @@ deploy_aidevops_agents() { # Copy VERSION file from repo root to deployed agents if [[ -f "$script_dir/VERSION" ]]; then - cp "$script_dir/VERSION" "$target_dir/VERSION" + if cp "$script_dir/VERSION" "$target_dir/VERSION"; then + print_info "Copied VERSION file to deployed agents" + else + print_warning "Failed to copy VERSION file (Plan+ may not read version correctly)" + fi + else + print_warning "VERSION file not found in repo root" fi # Inject extracted OpenCode plan-reminder into Plan+ if available