Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 14, 2026

Summary

Add subagents: frontmatter to primary agents that specifies which subagents should appear in the Task tool description. This reduces token overhead by filtering 220 subagents down to 3-30 per agent.

Changes

  • Add parse_frontmatter() to generate-opencode-agents.sh
  • Generate permission.task deny-list rules from subagents list
  • Add subagents: frontmatter to all 13 primary agents

How It Works

In agent frontmatter (e.g., .agent/seo.md):

---
name: seo
subagents:
  - keyword-research
  - google-search-console
  - dataforseo
  - general
  - explore
---

setup.sh generates (in ~/.config/opencode/opencode.json):

"SEO": {
  "permission": {
    "task": {
      "*": "deny",
      "keyword-research": "allow",
      "google-search-console": "allow",
      ...
    }
  }
}

Token Savings

Agent Subagents Reduction
Accounts 3 220 → 3 (98.6%)
Health 4 220 → 4 (98.2%)
Build+ 30 220 → 30 (86.4%)

Average reduction: ~94% fewer subagents in Task tool description per agent.

Related

Summary by CodeRabbit

  • New Features

    • Added subagents configuration for 13 agents, enabling grouped subagent lists across accounts, content, marketing, research, SEO, sales, onboarding, health, legal, plan-plus, build-plus, aidevops, and social-media.
  • Chores

    • Updated discovery process to consume subagent configuration, apply subagent-based permission filtering, and emit runtime reporting/logging during agent discovery.

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

Add 'subagents:' frontmatter to primary agents that specifies which
subagents should appear in the Task tool description. This reduces
token overhead by filtering 220 subagents down to 3-30 per agent.

Changes:
- Add parse_frontmatter() to generate-opencode-agents.sh
- Generate permission.task deny-list rules from subagents list
- Add subagents frontmatter to all 13 primary agents

Token savings: ~6-10k tokens per conversation by hiding irrelevant
subagents from the Task tool description.

Related: anomalyco/opencode#7271
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds subagents frontmatter to 13 agent markdown files and updates .agent/scripts/generate-opencode-agents.sh to parse frontmatter, apply subagent-aware deny-all-plus-allow permission filtering during agent generation, and emit discovery logging/counts.

Changes

Cohort / File(s) Summary
Agent Config - Small sets
​.agent/accounts.md, ​.agent/health.md, ​.agent/legal.md, ​.agent/research.md, ​.agent/seo.md, ​.agent/social-media.md
Added a subagents frontmatter array (small lists per agent). Declarative additions only.
Agent Config - Large / Categorized sets
​.agent/aidevops.md, ​.agent/build-plus.md, ​.agent/content.md, ​.agent/marketing.md, ​.agent/onboarding.md, ​.agent/plan-plus.md, ​.agent/sales.md
Added larger, categorized subagents frontmatter lists (multiple groups/entries). Declarative additions only.
Agent generation script
​.agent/scripts/generate-opencode-agents.sh
Added parse_frontmatter(filepath); extended get_agent_config(..., subagents=None); implemented subagent-aware deny-all + allow-list permission filtering; added subagent-filtered counting and logging; updated display-name resolution and discovery logs.

Sequence Diagram(s)

sequenceDiagram
  participant FS as Markdown files (.agent/*.md)
  participant Script as generate-opencode-agents.sh
  participant Registry as Generated agent configs / Permission system

  FS->>Script: script scans agent markdown files
  Script->>FS: parse_frontmatter(filepath) -> extract `subagents`
  Script->>Script: get_agent_config(display_name, filename, subagents)
  Script->>Registry: emit agent config with permissions (deny-all + allow subagents)
  Script->>Script: increment subagent_filtered_count / log discovery summary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🌱 Frontmatter sprouts a subagent tree,
Scripts read leaves and decide who may be,
Deny by default, then grant a few,
Counts climb, logs whisper what's new,
Agents align — small lines, big glee.

🚥 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 'feat(agents): add subagent filtering via frontmatter' directly and clearly describes the main change: introducing subagent filtering functionality through frontmatter declarations across agent files.
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.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b57978 and 3e035ba.

📒 Files selected for processing (1)
  • .agent/health.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .agent/health.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis

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.

@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 introduces a crucial optimization to the agent system by enabling explicit control over subagents associated with primary agents. By leveraging a new subagents field within YAML frontmatter in agent markdown files, the system now generates precise permission.task configurations. This targeted approach ensures that the Task tool only sees the most relevant subagents, leading to substantial token savings and improved efficiency in agent interactions.

Highlights

  • Subagent Filtering Introduced: Implemented subagents: frontmatter in primary agent markdown files, allowing explicit definition of relevant subagents for each agent.
  • New Frontmatter Parsing Logic: Added a parse_frontmatter() function to generate-opencode-agents.sh to extract YAML frontmatter, specifically the new subagents list.
  • Dynamic Permission Generation: The agent generation script now dynamically creates permission.task deny-list rules based on the subagents specified in the frontmatter, effectively filtering subagents presented to the Task tool.
  • Token Overhead Reduction: Applied the subagents: frontmatter to all 13 primary agents, resulting in an average reduction of approximately 94% in the number of subagents presented per agent, significantly reducing token overhead.
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.

@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, 260 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Jan 14 00:22:35 UTC 2026: Code review monitoring started
Wed Jan 14 00:22:36 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 260
Wed Jan 14 00:22:36 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Wed Jan 14 00:22:38 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 260
  • VULNERABILITIES: 0

Generated on: Wed Jan 14 00:23:16 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

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 introduces a subagent filtering mechanism using frontmatter in agent markdown files to reduce token overhead. The implementation involves adding a new parse_frontmatter function to a Python script, which manually parses YAML-like data, and then uses this data to generate permission rules. While the overall approach is sound and effectively addresses the token reduction goal, the new parser has some robustness issues that could lead to silent failures. My review includes a high-severity comment with a suggestion to improve the parser's reliability.

Comment on lines 185 to 233
def parse_frontmatter(filepath):
"""Parse YAML frontmatter from markdown file."""
try:
with open(filepath, 'r') as f:
content = f.read()
# Check for frontmatter
if not content.startswith('---'):
return {}
# Find end of frontmatter
end_idx = content.find('---', 3)
if end_idx == -1:
return {}
frontmatter = content[3:end_idx].strip()
# Simple YAML parsing for subagents list
result = {}
lines = frontmatter.split('\n')
current_key = None
current_list = []
for line in lines:
stripped = line.strip()
if stripped.startswith('- ') and current_key:
# List item
current_list.append(stripped[2:].strip())
elif ':' in stripped and not stripped.startswith('-'):
# Save previous list if any
if current_key and current_list:
result[current_key] = current_list
current_list = []
# New key
key, value = stripped.split(':', 1)
current_key = key.strip()
value = value.strip()
if value:
result[current_key] = value
current_key = None
# Save final list
if current_key and current_list:
result[current_key] = current_list
return result
except:
return {}

Choose a reason for hiding this comment

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

high

The custom frontmatter parser is quite fragile and could lead to silent failures. A silent failure here means subagent filtering won't be applied, which defeats the purpose of this change.

Specifically:

  1. It doesn't handle comments. A YAML comment (#) that contains a colon (:) would be incorrectly parsed as a key-value pair. While the current agent files don't trigger this, it's a potential bug for future changes.
  2. The except: block is too broad. It catches all exceptions, including SystemExit and KeyboardInterrupt, which is not recommended. It also fails silently by returning an empty dictionary, hiding parsing errors that should be addressed.

Using a standard library like PyYAML would be ideal, but if you prefer to avoid new dependencies, the existing parser can be made more robust. The suggestion below adds handling for comments and improves error reporting.

def parse_frontmatter(filepath):
    """Parse YAML frontmatter from markdown file."""
    try:
        with open(filepath, 'r', encoding='utf-8') as f:
            content = f.read()
        
        # Check for frontmatter
        if not content.startswith('---'):
            return {}
        
        # Find end of frontmatter
        end_idx = content.find('---', 3)
        if end_idx == -1:
            return {}
        
        frontmatter = content[3:end_idx].strip()
        
        # Simple YAML parsing for subagents list
        result = {}
        lines = frontmatter.split('\n')
        current_key = None
        current_list = []
        
        for line in lines:
            stripped = line.strip()
            # Ignore comments and empty lines for more robust parsing
            if not stripped or stripped.startswith('#'):
                continue

            if stripped.startswith('- ') and current_key:
                # List item
                current_list.append(stripped[2:].strip())
            elif ':' in stripped and not stripped.startswith('-'):
                # Save previous list if any
                if current_key and current_list:
                    result[current_key] = current_list
                    current_list = []
                
                # New key
                key, value = stripped.split(':', 1)
                current_key = key.strip()
                value = value.strip()
                if value:
                    result[current_key] = value
                    current_key = None
        
        # Save final list
        if current_key and current_list:
            result[current_key] = current_list
        
        return result
    except Exception as e:
        # Catch specific exceptions and log the error for easier debugging
        print(f"Warning: Failed to parse frontmatter for {filepath}: {e}", file=sys.stderr)
        return {}

Address Gemini Code Assist review feedback:
- Add encoding='utf-8' to file open
- Skip comments and empty lines in YAML parsing
- Use specific exception types instead of bare except
- Add warning message for parse failures

Co-authored-by: gemini-code-assist[bot] <176abortedflight+gemini-code-assist[bot]@users.noreply.github.com>
@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, 260 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Jan 14 00:25:36 UTC 2026: Code review monitoring started
Wed Jan 14 00:25:37 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 260
Wed Jan 14 00:25:37 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Wed Jan 14 00:25:39 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 260
  • VULNERABILITIES: 0

Generated on: Wed Jan 14 00:26:15 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.agent/marketing.md:
- Around line 13-29: The subagents list under the "subagents" key is using
invalid names; update entries to use the documented agent paths and remove
unsupported ones: replace "fluentcrm" with "services/crm/fluentcrm.md", replace
"dataforseo" with "seo/dataforseo.md", replace "google-search-console" with
"seo/google-search-console.md", and remove the undefined entries "guidelines",
"summarize", "keyword-research", "serper", "bird", "general", and "explore";
ensure the final "subagents" array only contains valid .agent/* markdown paths
per AGENTS.md.

In @.agent/seo.md:
- Around line 5-16: The frontmatter references a missing subagent "pagespeed" so
either remove "pagespeed" from the subagents list or add the corresponding
pagespeed subagent file; update the subagents array (e.g., remove the
"pagespeed" entry) and, if adding, create the new pagespeed subagent document
with the same structure as the other subagents. Also update the documentation
table to add "domain-research" as an entry and mark "general" and "explore" as
built-ins so the table accurately reflects available subagents.
🧹 Nitpick comments (3)
.agent/scripts/generate-opencode-agents.sh (2)

185-233: Solid frontmatter parser with room for edge-case hardening.

The parse_frontmatter() implementation handles basic YAML list parsing well, but a few edge cases could cause unexpected behavior:

  1. Line 220: stripped.split(':', 1) on a line like description: "foo: bar" will correctly split at the first colon, but quoted values containing colons in list items (line 212) aren't handled.

  2. Line 232: The bare except: swallows all exceptions silently. Consider logging parse failures to aid debugging when subagent filtering doesn't work as expected.

  3. Inline list syntax (e.g., subagents: [foo, bar]) isn't parsed—only multi-line YAML lists work.

These are minor given the controlled input (your own .md files), but worth noting for robustness.

🔧 Optional: Add debug logging for parse failures
     except:
+        # Uncomment for debugging: print(f"    Warning: Failed to parse frontmatter in {filepath}", file=sys.stderr)
         return {}

268-276: Permission filtering logic is correct, but add validation to prevent future typos in subagent references.

The deny-all + allow-specific pattern ("*": "deny" followed by per-subagent "allow") correctly implements least-privilege filtering. The logging provides good visibility.

However, there's no validation that subagent names in frontmatter actually correspond to files. While all current subagent references are valid (verified across workflows, code-review, context, browser, seo, and services directories), a typo could silently create incorrect permission filtering. Consider adding a check during script execution to warn if a referenced subagent file is not found.

.agent/health.md (1)

5-11: Remove context7 subagent or document research workflows

context7 is fundamentally misaligned—it provides development library/framework documentation, not health information. crawl4ai could support future health research workflows, but none are currently documented. The agent's scope (Developer Wellness, Work-Life Balance, Ergonomics) operates independently without external research. If health research is planned, document those workflows; otherwise, rely on general and explore for the current wellness-tracking scope. Note: A separate research.md agent already handles research tasks with these tools.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4140635 and f07222a.

📒 Files selected for processing (14)
  • .agent/accounts.md
  • .agent/aidevops.md
  • .agent/build-plus.md
  • .agent/content.md
  • .agent/health.md
  • .agent/legal.md
  • .agent/marketing.md
  • .agent/onboarding.md
  • .agent/plan-plus.md
  • .agent/research.md
  • .agent/sales.md
  • .agent/scripts/generate-opencode-agents.sh
  • .agent/seo.md
  • .agent/social-media.md
🧰 Additional context used
📓 Path-based instructions (1)
.agent/scripts/*.sh

⚙️ CodeRabbit configuration file

.agent/scripts/*.sh: Automation scripts - focus on:

  • Reliability and robustness
  • Clear logging and feedback
  • Proper exit codes
  • Error recovery mechanisms

Files:

  • .agent/scripts/generate-opencode-agents.sh
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/AGENTS.md : Limit root AGENTS.md to ~50-100 max instructions with universal applicability to >80% of tasks
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/AGENTS.md : Use progressive disclosure in AGENTS.md with pointers to subagents rather than inline content
📚 Learning: 2026-01-06T15:57:56.027Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/AGENTS.md : Use progressive disclosure in AGENTS.md with pointers to subagents rather than inline content

Applied to files:

  • .agent/onboarding.md
  • .agent/accounts.md
  • .agent/legal.md
  • .agent/aidevops.md
  • .agent/content.md
  • .agent/social-media.md
  • .agent/build-plus.md
  • .agent/research.md
  • .agent/sales.md
  • .agent/plan-plus.md
  • .agent/health.md
📚 Learning: 2025-11-29T04:34:42.033Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENT.md:0-0
Timestamp: 2025-11-29T04:34:42.033Z
Learning: Reference AGENTS.md (authoritative) instead of AGENT.md for AI assistant guidance

Applied to files:

  • .agent/onboarding.md
  • .agent/legal.md
  • .agent/aidevops.md
  • .agent/content.md
  • .agent/social-media.md
  • .agent/research.md
  • .agent/sales.md
  • .agent/plan-plus.md
  • .agent/health.md
📚 Learning: 2025-11-29T04:34:27.158Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T04:34:27.158Z
Learning: All instructions, documentation, and operational guidance should be maintained in AGENTS.md as the single source of truth

Applied to files:

  • .agent/onboarding.md
  • .agent/legal.md
  • .agent/aidevops.md
  • .agent/content.md
📚 Learning: 2026-01-06T15:57:56.027Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/AGENTS.md : Limit root AGENTS.md to ~50-100 max instructions with universal applicability to >80% of tasks

Applied to files:

  • .agent/onboarding.md
  • .agent/legal.md
  • .agent/aidevops.md
  • .agent/content.md
  • .agent/marketing.md
  • .agent/sales.md
  • .agent/plan-plus.md
📚 Learning: 2025-11-29T04:34:30.742Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.742Z
Learning: Maintain all instructions, documentation, and operational guidance in AGENTS.md as the single source of truth

Applied to files:

  • .agent/onboarding.md
  • .agent/aidevops.md
📚 Learning: 2025-11-29T04:34:42.033Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENT.md:0-0
Timestamp: 2025-11-29T04:34:42.033Z
Learning: Maintain all AI assistant instructions, documentation, and operational guidance in AGENTS.md as the single source of truth

Applied to files:

  • .agent/aidevops.md
📚 Learning: 2025-12-22T01:24:53.937Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-12-22T01:24:53.937Z
Learning: Follow all security protocols and working directory specifications defined in ~/Git/aidevops/AGENTS.md

Applied to files:

  • .agent/aidevops.md
📚 Learning: 2025-12-22T01:24:53.937Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-12-22T01:24:53.937Z
Learning: Reference the authoritative repository at ~/Git/aidevops/ for all detailed AI assistant instructions and configurations

Applied to files:

  • .agent/aidevops.md
📚 Learning: 2025-12-22T01:25:03.138Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/git/AGENTS.md:0-0
Timestamp: 2025-12-22T01:25:03.138Z
Learning: Use standardized patterns as defined in the authoritative DevOps repository at ~/Git/aidevops/

Applied to files:

  • .agent/aidevops.md
📚 Learning: 2025-12-22T01:24:53.937Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: templates/home/AGENTS.md:0-0
Timestamp: 2025-12-22T01:24:53.937Z
Learning: Use only the specified working directories: ~/.aidevops/.agent-workspace/work/[project]/ for work files, ~/.aidevops/.agent-workspace/tmp/ for temporary files, and ~/.aidevops/.agent-workspace/memory/ for persistent memory

Applied to files:

  • .agent/aidevops.md
📚 Learning: 2025-11-29T04:34:30.742Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.742Z
Learning: Reference AGENTS.md for authoritative AI assistant guidance instead of GEMINI.md

Applied to files:

  • .agent/social-media.md
  • .agent/research.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (12)
.agent/scripts/generate-opencode-agents.sh (2)

282-282: Good instrumentation with subagent_filtered_count.

The counter and conditional check provide clear feedback on how many agents have filtering applied. The logic correctly increments only when subagents is truthy.

Also applies to: 290-297


364-365: Clear summary output for subagent filtering.

The conditional print on lines 364-365 provides useful feedback without cluttering output when filtering isn't in use. Aligns well with the script's existing logging patterns.

.agent/research.md (1)

5-18: Well-structured subagents list for Research agent.

The categorization with inline comments (Context/docs, Web research, Summarization, Built-in) improves readability. The selected subagents align well with the agent's purpose: research and analysis tasks requiring documentation lookup, web crawling, and summarization.

.agent/sales.md (1)

13-25: Subagents list properly scoped to Sales operations.

The selected subagents directly support the workflows documented in the file:

  • fluentcrm → CRM Integration section (line 68+)
  • quickfile → Quote to Invoice Flow (line 245+)
  • outscraper, crawl4ai → Lead research capabilities
  • guidelines → Proposal creation (line 222+)

Good alignment between declared subagents and documented functionality.

.agent/aidevops.md (1)

5-40: Comprehensive subagent list appropriate for framework meta-agent.

With 36 subagents, this is the largest list in the PR, which aligns with the AI-DevOps agent's role as the framework orchestration hub. The categorization is clear:

  • Framework internals (setup, troubleshooting, architecture, MCP configs)
  • Agent development (build-agent, build-mcp, server-patterns)
  • Workflows (git-workflow, release, version-bump)
  • Code quality (code-standards, linters-local, secretlint)
  • Credentials (api-key-setup, vaultwarden)

The PR objective mentions "Build+ 220 → 30" as an example, so 36 for the framework agent is within expected range.

.agent/social-media.md (1)

5-16: Focused subagent list for Social Media management.

The 7 subagents provide targeted capabilities:

  • bird → Twitter/X platform (mentioned in line 69)
  • guidelines, summarize → Content planning (line 41+)
  • crawl4ai, serper → Competitor and trend analysis (lines 63-64, 80-81)

The list appropriately references content.md, marketing.md, seo.md, and research.md in the Integration Points section (lines 78-81), showing good cross-agent coordination awareness.

.agent/accounts.md (1)

5-8: LGTM - Clean subagent filtering configuration

The subagent list is appropriate for an accounting agent: quickfile for the primary QuickFile integration (referenced at lines 21, 36, 69), and the standard general/explore built-ins. This reduces token overhead from 220 to just 3 subagents (~98.6% reduction).

.agent/legal.md (1)

5-13: LGTM - Appropriate subagent selection for legal workflows

The subagent configuration is well-aligned with the agent's documented workflows:

  • Research tools (context7, crawl4ai) support document review (lines 39-44) and compliance checking (lines 55-60)
  • guidelines subagent fits policy generation needs (lines 47-52)
  • Built-ins provide general capabilities

Token reduction from 220 to 5 (~97.7%) while maintaining necessary functionality.

.agent/onboarding.md (1)

5-17: Subagent configuration references non-existent files - cannot approve

All 8 declared subagents are missing (.agent/setup.md, .agent/troubleshooting.md, .agent/api-key-setup.md, .agent/list-keys.md, .agent/mcp-integrations.md, .agent/services.md, .agent/service-links.md, .agent/general.md, .agent/explore.md). With mode: subagent, this configuration will fail at runtime.

Additional concerns:

  • Content bloat: onboarding.md is 809 lines vs. the 50–100 line target from learnings. The first section alone contains ~350 lines of inline detailed instructions.
  • Missing progressive disclosure: Learnings recommend pointers to subagents rather than inline content. Current structure embeds full workflows inline instead of delegating to referenced subagents.

Required before merge:

  1. Create the 8 subagent files or remove them from the subagent list if they're WIP
  2. Consolidate onboarding.md to ~50–100 core instructions with pointers to subagents for detailed workflows
⛔ Skipped due to learnings
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/AGENTS.md : Limit root AGENTS.md to ~50-100 max instructions with universal applicability to >80% of tasks
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.027Z
Learning: Applies to **/AGENTS.md : Use progressive disclosure in AGENTS.md with pointers to subagents rather than inline content
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T04:34:27.158Z
Learning: All instructions, documentation, and operational guidance should be maintained in AGENTS.md as the single source of truth
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.742Z
Learning: Maintain all instructions, documentation, and operational guidance in AGENTS.md as the single source of truth
.agent/build-plus.md (1)

5-42: Excellent organization with categorized subagents.

The use of inline comments to categorize 30 subagents into logical groups (Core workflows, Code quality, Context tools, Browser/testing, Git platforms, Deployment, Built-in) is a maintainability best practice. This organization pattern makes the extensive list easy to audit and update.

The comprehensive scope is appropriate for an autonomous build agent that needs access to quality gates, context tools, and deployment workflows.

.agent/content.md (1)

5-20: LGTM! Well-scoped content subagent list with clear categorization.

The subagent list appropriately covers content creation workflows while integrating SEO optimization (keyword-research, eeat-score) and publishing tools (wp-admin, mainwp). The categorical organization following the build-plus.md pattern promotes consistency across agent configurations.

.agent/plan-plus.md (1)

5-22: Perfect alignment with Plan+ read-only constraints.

The subagent list is carefully scoped to maintain Plan+'s read-only nature. Context/search tools dominate (osgrep, augment-context-engine, context-builder, context7), while planning and architecture review subagents support the analysis phase. Notably absent are any write, deployment, or modification tools—excellent constraint enforcement.

The categorical organization clearly communicates the agent's capabilities and limitations.

Comment on lines +13 to +29
subagents:
# CRM
- fluentcrm
# Content
- guidelines
- summarize
# SEO
- keyword-research
- serper
- dataforseo
# Social
- bird
# Analytics
- google-search-console
# Built-in
- general
- explore
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Explore .agent directory structure
find .agent -type f -name "*.md" | head -20

Repository: marcusquinn/aidevops

Length of output: 696


🏁 Script executed:

# Check if .agent/marketing.md exists and get its line count
if [ -f .agent/marketing.md ]; then
  wc -l .agent/marketing.md
  echo "---"
  echo "Lines 13-29:"
  sed -n '13,29p' .agent/marketing.md
else
  echo ".agent/marketing.md does not exist"
fi

Repository: marcusquinn/aidevops

Length of output: 330


🏁 Script executed:

# Verify referenced subagent files
for agent in bird dataforseo google-search-console keyword-research serper fluentcrm guidelines summarize general explore; do
  if [ -f ".agent/${agent}.md" ]; then
    echo "✓ .agent/${agent}.md exists"
  else
    echo "✗ .agent/${agent}.md NOT FOUND"
  fi
done

Repository: marcusquinn/aidevops

Length of output: 392


🏁 Script executed:

# Check lines 303-322 in marketing.md for SEO integration claims
if [ -f .agent/marketing.md ]; then
  echo "Lines 303-322 in .agent/marketing.md:"
  sed -n '303,322p' .agent/marketing.md
fi

Repository: marcusquinn/aidevops

Length of output: 654


🏁 Script executed:

# Check fluentcrm documentation extent (lines 39-457)
if [ -f .agent/marketing.md ]; then
  echo "Checking line 39 and nearby:"
  sed -n '35,45p' .agent/marketing.md
  echo "---"
  echo "Checking line 457 and nearby:"
  sed -n '450,457p' .agent/marketing.md | head -20
fi

Repository: marcusquinn/aidevops

Length of output: 736


🏁 Script executed:

# Check AGENTS.md for subagent definitions
if [ -f .agent/AGENTS.md ]; then
  echo "Checking .agent/AGENTS.md for subagent configuration:"
  head -100 .agent/AGENTS.md
fi

Repository: marcusquinn/aidevops

Length of output: 4612


🏁 Script executed:

# Search for any mention of subagents in AGENTS.md
if [ -f .agent/AGENTS.md ]; then
  echo "Searching for 'subagents' in AGENTS.md:"
  grep -n "subagents" .agent/AGENTS.md
fi

Repository: marcusquinn/aidevops

Length of output: 369


🏁 Script executed:

# Check directory structure for actual agent definitions
echo "Checking .agent directory for any agent MD files:"
ls -la .agent/*.md 2>/dev/null | head -20

Repository: marcusquinn/aidevops

Length of output: 1073


🏁 Script executed:

# Show full marketing.md to understand subagent structure
wc -l .agent/marketing.md && echo "---" && head -50 .agent/marketing.md

Repository: marcusquinn/aidevops

Length of output: 1032


🏁 Script executed:

# Check if there's a services subdirectory with agent definitions
find .agent -type d | head -20

Repository: marcusquinn/aidevops

Length of output: 472


🏁 Script executed:

# Search for how subagents are referenced or defined in AGENTS.md
grep -A 20 "How to use subagents" .agent/AGENTS.md

Repository: marcusquinn/aidevops

Length of output: 1359


Reject subagent declarations—most do not exist in the framework

The subagents list references agents that either don't exist or use incorrect paths. Per AGENTS.md documentation, valid agent paths are:

  • seo/dataforseo.md (not dataforseo)
  • seo/google-search-console.md (not google-search-console)
  • services/crm/fluentcrm.md (not fluentcrm)

The following subagents are not defined in the framework and must be removed:

  • guidelines, summarize, keyword-research, serper, bird, general, explore

Correct the subagent declarations to use valid paths from the .agent/ directory structure, or remove unsupported entries entirely.

🤖 Prompt for AI Agents
In @.agent/marketing.md around lines 13 - 29, The subagents list under the
"subagents" key is using invalid names; update entries to use the documented
agent paths and remove unsupported ones: replace "fluentcrm" with
"services/crm/fluentcrm.md", replace "dataforseo" with "seo/dataforseo.md",
replace "google-search-console" with "seo/google-search-console.md", and remove
the undefined entries "guidelines", "summarize", "keyword-research", "serper",
"bird", "general", and "explore"; ensure the final "subagents" array only
contains valid .agent/* markdown paths per AGENTS.md.

Comment on lines +5 to +16
subagents:
- keyword-research
- google-search-console
- gsc-sitemaps
- dataforseo
- serper
- site-crawler
- eeat-score
- domain-research
- pagespeed
- general
- explore
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's find the seo.md file and explore the .agent directory structure
find . -name "seo.md" -type f | head -20

Repository: marcusquinn/aidevops

Length of output: 79


🏁 Script executed:

# List all files in .agent directory to understand structure
find .agent -type f -name "*.md" | head -30

Repository: marcusquinn/aidevops

Length of output: 1052


🏁 Script executed:

# Check the content of .agent/seo.md, focusing on lines 1-50 to see frontmatter and documented table
if [ -f ".agent/seo.md" ]; then
  head -50 .agent/seo.md | cat -n
fi

Repository: marcusquinn/aidevops

Length of output: 2109


🏁 Script executed:

# Get all files in .agent/seo/ directory
ls -la .agent/seo/ | tail -n +4

Repository: marcusquinn/aidevops

Length of output: 605


🏁 Script executed:

# Count and list all subagent files
find .agent/seo -type f -name "*.md" | sort

Repository: marcusquinn/aidevops

Length of output: 285


Remove pagespeed subagent reference or add the corresponding file.

The subagent pagespeed (line 14) is referenced in the frontmatter but .agent/seo/pagespeed.md does not exist. Either remove this reference or add the missing file. The other eight listed subagents (keyword-research, google-search-console, gsc-sitemaps, dataforseo, serper, site-crawler, eeat-score, domain-research) are correctly implemented.

Additionally, the documentation table (lines 30-40) should be updated to include domain-research and note that general and explore are built-ins.

🤖 Prompt for AI Agents
In @.agent/seo.md around lines 5 - 16, The frontmatter references a missing
subagent "pagespeed" so either remove "pagespeed" from the subagents list or add
the corresponding pagespeed subagent file; update the subagents array (e.g.,
remove the "pagespeed" entry) and, if adding, create the new pagespeed subagent
document with the same structure as the other subagents. Also update the
documentation table to add "domain-research" as an entry and mark "general" and
"explore" as built-ins so the table accurately reflects available subagents.

@augmentcode
Copy link

augmentcode bot commented Jan 14, 2026

🤖 Augment PR Summary

Summary: Adds per-primary-agent subagents: frontmatter to control which subagents appear in the OpenCode Task tool description, reducing token overhead.

Changes:

  • Added subagents: lists to all 13 primary agent markdown files under .agent/.
  • Introduced parse_frontmatter() in .agent/scripts/generate-opencode-agents.sh to read YAML frontmatter from agent files.
  • Extended get_agent_config() to accept an optional subagents allow-list.
  • When present, generator emits permission.task rules as deny-all + explicit allow entries for listed subagents.
  • Added generator output showing how many agents were discovered and how many received Task filtering rules.

Technical Notes: Filtering is implemented via generated OpenCode config (~/.config/opencode/opencode.json) without requiring upstream OpenCode native support, enabling immediate per-agent Task trimming.

🤖 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. 1 suggestions posted.

Fix All in Augment

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

if subagents:
subagent_filtered_count += 1
primary_agents[display_name] = get_agent_config(display_name, filename, subagents)
Copy link

Choose a reason for hiding this comment

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

subagent_filtered_count increments on any truthy subagents value, but filtering is only applied when subagents is a non-empty list in get_agent_config(). This can make the end-of-run “Subagent filtering” summary look successful even if frontmatter is malformed (e.g., subagents: foo).

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@marcusquinn
Copy link
Owner Author

Response to CodeRabbit Review

Re: "Invalid subagent names"

The subagent names are correct. The generate-opencode-agents.sh script generates subagent files in ~/.config/opencode/agent/ using the filename without extension as the identifier:

$ ls ~/.config/opencode/agent/ | head -5
101domains.md
agent-review.md
api-key-setup.md
...

So fluentcrm, dataforseo, quickfile etc. are the correct names - not full paths like services/crm/fluentcrm.md.

Re: "Missing pagespeed subagent"

pagespeed.md exists:

$ ls ~/.config/opencode/agent/ | grep pagespeed
pagespeed.md

Re: Parser robustness

Already addressed in commit 0b57978 based on Gemini feedback - added comment handling, specific exception types, and warning messages.

Re: health.md context7

Fair point - context7 is for library docs. Removed in next commit along with other minor cleanups.

context7 provides library/framework docs, not health information.
crawl4ai is sufficient for health research workflows.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link

@marcusquinn
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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, 260 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Jan 14 00:31:04 UTC 2026: Code review monitoring started
Wed Jan 14 00:31:04 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 260
Wed Jan 14 00:31:04 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Wed Jan 14 00:31:06 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 260
  • VULNERABILITIES: 0

Generated on: Wed Jan 14 00:31:49 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit b32a3f3 into main Jan 14, 2026
9 checks passed
@marcusquinn marcusquinn deleted the feature/subagent-filtering branch January 14, 2026 00:45
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