Skip to content

Conversation

@ANcpLua
Copy link
Owner

@ANcpLua ANcpLua commented Jan 6, 2026

Summary

  • Fix tools field format in agents (string → YAML array) - this was causing plugins to be stuck in "installed" state
  • Add SessionStart freshness hooks for otelwiki and ancplua-docs-librarian using NuGet API as source of truth
  • Upgrade agents to opus model for better reasoning
  • Add WebSearch/WebFetch tools to agents for version checking
  • Document xUnit v3 + MTP requirements (exe output, matching versions)

Changes

File Change
otelwiki/agents/*.md Fixed tools array, added web tools, upgraded to opus
metacognitive-guard/agents/*.md Upgraded to opus, added WebSearch
ancplua-docs-librarian/agents/*.md Fixed tools array, added xUnit v3 + MTP docs
*/hooks/hooks.json Added SessionStart freshness prompts
*/.claude-plugin/plugin.json Added missing hooks declarations

Test plan

  • Verified NuGet API returns structured JSON for all packages
  • Verified hooks JSON is valid
  • Tested xunit.v3 and xunit.v3.mtp-v2 both at 3.2.1

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed agent tools configuration format in multiple agents
    • Added missing hooks declarations to plugin configurations
    • Introduced automatic version freshness checks via SessionStart hooks
  • New Features

    • Added WebSearch and WebFetch capabilities to agents
    • Expanded agent tooling options for enhanced functionality
  • Improvements

    • Upgraded agent models for better performance

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

- Fix tools field format in agents (string → array)
- Add SessionStart freshness hooks for otelwiki and ancplua-docs-librarian
- Use NuGet API as source of truth for version checking
- Upgrade agents to opus model for better reasoning
- Add WebSearch/WebFetch tools to agents
- Document xUnit v3 + MTP requirements (exe output, matching versions)
- Add hooks declarations to plugin.json files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

This PR adds hooks infrastructure to three plugins and upgrades their configurations. It fixes tools field formatting in agent configs from strings to YAML lists, upgrades models from haiku/sonnet to opus, adds WebSearch/WebFetch capabilities to agents, introduces SessionStart hooks with freshness-check prompts, and updates agent guidance documentation to reflect new capabilities and version-checking workflows.

Changes

Cohort / File(s) Summary
Plugin Manifests
plugins/ancplua-docs-librarian/.claude-plugin/plugin.json, plugins/metacognitive-guard/.claude-plugin/plugin.json, plugins/otelwiki/.claude-plugin/plugin.json
Added hooks property pointing to ./hooks/hooks.json in each plugin manifest.
Agent Configurations
plugins/ancplua-docs-librarian/agents/ancplua-librarian.md, plugins/metacognitive-guard/agents/arch-reviewer.md, plugins/metacognitive-guard/agents/impl-reviewer.md, plugins/otelwiki/agents/otel-guide.md, plugins/otelwiki/agents/otel-librarian.md
Updated model field from haiku/sonnet to opus; added WebSearch and/or WebFetch to tools lists; expanded agent guidance with web capabilities sections, testing requirements, and architecture review context.
Hooks Definitions
plugins/ancplua-docs-librarian/hooks/hooks.json, plugins/otelwiki/hooks/hooks.json
Introduced SessionStart hooks with prompts for automated freshness checks, version detection via NuGet endpoints and local files, and mismatch handling guidance.
Freshness Check Script
plugins/otelwiki/scripts/check-freshness.sh
Refactored to replace age-based warnings with SessionStart prompt mechanism; now reads VERSION.md semconv version and outputs initialization status prompt.
Changelog
CHANGELOG.md
Added "Fixed" entries documenting YAML format corrections, missing hooks declarations, and unified freshness hooks with version checks.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Plugin as Plugin<br/>(SessionStart)
    participant Hook as SessionStart Hook
    participant VersionCheck as Freshness Check<br/>(Local/NuGet)
    participant Prompt as Prompt Output

    User ->> Plugin: Load plugin
    Plugin ->> Hook: Trigger SessionStart hook
    Hook ->> VersionCheck: Check VERSION.md & NuGet
    alt Version data exists
        VersionCheck ->> VersionCheck: Compare SDK versions
        VersionCheck ->> Prompt: Generate version mismatch alert
    else Not initialized
        VersionCheck ->> Prompt: Generate init suggestion
    end
    Prompt ->> User: Display freshness/setup prompt
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Pre-merge checks and finishing touches

✅ 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 accurately summarizes the three main changes: fixing agent YAML format, adding freshness hooks, and upgrading models. It is concise, specific, and directly reflects the changeset's primary objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix/plugin-agents-freshness-hooks

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 @ANcpLua, 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 reliability, intelligence, and data freshness of the agent ecosystem. By standardizing agent tool configurations, upgrading to more capable language models, and implementing proactive version checking mechanisms, the agents are now better equipped to provide accurate and current information, preventing the use of outdated APIs or patterns. The changes ensure agents can self-verify information and provide more relevant guidance.

Highlights

  • Agent YAML Format Fix: Corrected the tools field format in agent YAML configurations from a string to a proper YAML array, resolving issues where plugins were getting stuck in an 'installed' state.
  • Freshness Hooks Implementation: Introduced SessionStart freshness hooks for otelwiki and ancplua-docs-librarian plugins, leveraging the NuGet API as the source of truth to ensure documentation and package versions are up-to-date.
  • Model Upgrades: Upgraded several agent models from haiku or sonnet to opus for enhanced reasoning capabilities, improving their ability to process and respond to complex queries.
  • Web Tools Integration: Integrated WebSearch and WebFetch tools into agents, enabling them to perform real-time version checks and gather external information when needed.
  • xUnit v3 + MTP Documentation: Added specific documentation within the ancplua-librarian agent for xUnit v3 and Microsoft Testing Platform (MTP) requirements, including output type and execution commands.
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.

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 significant updates across several plugins, primarily focusing on agent capabilities and documentation freshness. Key changes include standardizing agent tools fields to YAML array format, adding WebSearch and WebFetch tools to most agents for improved information retrieval, and upgrading agent models (e.g., from haiku/sonnet to opus) for enhanced reasoning. The PR also integrates new SessionStart hooks into ancplua-docs-librarian, metacognitive-guard, and otelwiki plugins to proactively check for documentation and package version freshness, prompting users for updates or automatically proceeding based on keywords. Specifically, the ancplua-docs-librarian agent now includes detailed testing requirements for xUnit v3 and MTP, and both ancplua-docs-librarian and otelwiki agents received new 'Web Capabilities' guidance. The otelwiki freshness script was refactored to simplify its prompting logic. Review comments highlighted the need to add set -euo pipefail to a shell script for robustness, specify the language for a code block in ancplua-librarian.md as text, and remove trailing spaces in a prompt string within ancplua-docs-librarian/hooks/hooks.json.

@@ -1,24 +1,13 @@
#!/bin/bash

Choose a reason for hiding this comment

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

medium

The repository style guide requires shell scripts to start with set -euo pipefail for robustness and to prevent unexpected behavior on errors. This script is missing that declaration.

Suggested change
#!/bin/bash
#!/bin/bash
set -euo pipefail
References
  1. Repository style guide line 62: 'Use set -euo pipefail at script start' (link)

- Run tests with: `dotnet run` (not `dotnet test`) or use MTP runner

**NuGet API for version check:**
```

Choose a reason for hiding this comment

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

low

The repository style guide requires that all code blocks specify a language. This block containing URLs is missing its specifier. Using text would be appropriate here.

Suggested change
```
```text
References
  1. Repository style guide line 77: 'Code blocks must specify language' (link)

"hooks": [
{
"type": "prompt",
"prompt": "ANcpLua Docs Librarian loaded.\n\n**Auto-freshness** (if user says search/latest/update/versions) OR ask 'Quick version check? (yes/no)':\n\n**NuGet API is source of truth:**\n1. WebFetch 'https://api.nuget.org/v3-flatcontainer/ancplua.net.sdk/index.json' → latest SDK version\n2. WebFetch 'https://api.nuget.org/v3-flatcontainer/microsoft.codeanalysis.csharp/index.json' → latest Roslyn\n3. Read local Version.props in each repo → current versions\n4. Compare → report delta\n\n**Key packages:**\n- ancplua.net.sdk\n- ancplua.analyzers \n- microsoft.codeanalysis.csharp\n- xunit.v3 + xunit.v3.mtp-v2 (must match, exe output required)\n\n**If mismatch:** 'Local uses X.Y, NuGet has A.B - verifying patterns still apply'\n\nKeep it quick - user is waiting."

Choose a reason for hiding this comment

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

low

There are some trailing spaces after ancplua.analyzers. These should be removed for cleanliness.

Suggested change
"prompt": "ANcpLua Docs Librarian loaded.\n\n**Auto-freshness** (if user says search/latest/update/versions) OR ask 'Quick version check? (yes/no)':\n\n**NuGet API is source of truth:**\n1. WebFetch 'https://api.nuget.org/v3-flatcontainer/ancplua.net.sdk/index.json' → latest SDK version\n2. WebFetch 'https://api.nuget.org/v3-flatcontainer/microsoft.codeanalysis.csharp/index.json' → latest Roslyn\n3. Read local Version.props in each repo → current versions\n4. Compare → report delta\n\n**Key packages:**\n- ancplua.net.sdk\n- ancplua.analyzers \n- microsoft.codeanalysis.csharp\n- xunit.v3 + xunit.v3.mtp-v2 (must match, exe output required)\n\n**If mismatch:** 'Local uses X.Y, NuGet has A.B - verifying patterns still apply'\n\nKeep it quick - user is waiting."
"prompt": "ANcpLua Docs Librarian loaded.\n\n**Auto-freshness** (if user says search/latest/update/versions) OR ask 'Quick version check? (yes/no)':\n\n**NuGet API is source of truth:**\n1. WebFetch 'https://api.nuget.org/v3-flatcontainer/ancplua.net.sdk/index.json' → latest SDK version\n2. WebFetch 'https://api.nuget.org/v3-flatcontainer/microsoft.codeanalysis.csharp/index.json' → latest Roslyn\n3. Read local Version.props in each repo → current versions\n4. Compare → report delta\n\n**Key packages:**\n- ancplua.net.sdk\n- ancplua.analyzers\n- microsoft.codeanalysis.csharp\n- xunit.v3 + xunit.v3.mtp-v2 (must match, exe output required)\n\n**If mismatch:** 'Local uses X.Y, NuGet has A.B - verifying patterns still apply'\n\nKeep it quick - user is waiting."

Copy link

@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: 0

🧹 Nitpick comments (5)
plugins/otelwiki/agents/otel-guide.md (1)

81-89: Consider clarifying the sync mechanism.

The guidance clearly lists when to use web tools. However, line 89 references /otelwiki:sync without explaining what this command does or how to invoke it. Consider adding a brief note (e.g., "synced via the /otelwiki:sync skill command").

plugins/ancplua-docs-librarian/hooks/hooks.json (1)

8-8: Consider formatting the long prompt for better maintainability.

The entire SessionStart prompt is on a single line (282+ characters), which makes it harder to read and maintain. While JSON doesn't require line breaks in strings, consider either:

  1. Using proper JSON string escaping with \n to preserve the multiline format explicitly
  2. Documenting that the prompt formatting is intentional for runtime rendering

This is a minor readability concern and doesn't affect functionality.

plugins/otelwiki/hooks/hooks.json (1)

10-13: Consider extracting long prompt to separate file for maintainability.

The SessionStart prompt hook is correctly implemented and provides clear freshness-checking workflow instructions. However, the 500+ character prompt string on line 12 could be difficult to maintain inline.

🔎 Optional refactor to improve maintainability

Consider extracting the prompt to a separate file (e.g., prompts/session-start.txt) and referencing it:

 {
   "type": "prompt",
-  "prompt": "OTel docs plugin loaded. Follow this flow:\n\n1. IF user mentions 'search/web/latest/update' → auto-proceed with checks (don't ask)\n\n2. OTHERWISE ask: 'Sync OTel docs? (yes/no)'\n\n**Freshness sources:**\n- Semconv: WebFetch 'https://api.github.com/repos/open-telemetry/semantic-conventions/releases/latest'\n- .NET SDK: WebFetch 'https://api.nuget.org/v3-flatcontainer/opentelemetry/index.json'\n- Read ${CLAUDE_PLUGIN_ROOT}/docs/VERSION.md → local version\n- Compare → report delta\n\n**On YES:** run /otelwiki:sync, then show what changed\n**On NO:** 'Check for patches?' → YES = fetch latest release notes, NO = proceed\n\nKeep it quick - user is waiting."
+  "promptFile": "${CLAUDE_PLUGIN_ROOT}/prompts/session-start.txt"
 }

Note: This assumes the hooks system supports promptFile as an alternative to inline prompt. If not supported, the current approach is acceptable.

plugins/otelwiki/scripts/check-freshness.sh (2)

9-9: Consider more robust version extraction pattern.

The current regex '[0-9]+\.[0-9]+\.[0-9]+' will match any three-part number in the line, which could extract an unintended version if the file contains multiple semver patterns.

🔎 More specific pattern
-  CURRENT_VERSION=$(grep -m1 "semconv" "$VERSION_FILE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
+  CURRENT_VERSION=$(grep -m1 "semconv" "$VERSION_FILE" | grep -oP 'semconv[:\s]+v?\K[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")

This pattern:

  • Uses \K to exclude the "semconv" prefix from the match
  • Handles optional "v" prefix (v1.2.3)
  • Anchors to "semconv" followed by colon or whitespace

1-13: Consider adding bash strict mode for defensive coding.

While the script is simple and handles errors with fallbacks, adding strict mode flags would align with shellcheck best practices.

🔎 Add strict mode
 #!/bin/bash
+set -euo pipefail
 # Prompt user to sync OTel docs at session start

Benefits:

  • -e: Exit on error
  • -u: Error on undefined variables
  • -o pipefail: Catch errors in pipelines
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3de6c40 and da6f5a2.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • plugins/ancplua-docs-librarian/.claude-plugin/plugin.json
  • plugins/ancplua-docs-librarian/agents/ancplua-librarian.md
  • plugins/ancplua-docs-librarian/hooks/hooks.json
  • plugins/metacognitive-guard/.claude-plugin/plugin.json
  • plugins/metacognitive-guard/agents/arch-reviewer.md
  • plugins/metacognitive-guard/agents/impl-reviewer.md
  • plugins/otelwiki/.claude-plugin/plugin.json
  • plugins/otelwiki/agents/otel-guide.md
  • plugins/otelwiki/agents/otel-librarian.md
  • plugins/otelwiki/hooks/hooks.json
  • plugins/otelwiki/scripts/check-freshness.sh
🧰 Additional context used
📓 Path-based instructions (1)
plugins/**

⚙️ CodeRabbit configuration file

plugins/**: Review for:

  • Plugin structure compliance (plugin.json, skills/, commands/)
  • SKILL.md has proper YAML frontmatter
  • Security: no hardcoded secrets
  • Shell scripts are shellcheck-compliant

Files:

  • plugins/otelwiki/agents/otel-librarian.md
  • plugins/ancplua-docs-librarian/agents/ancplua-librarian.md
  • plugins/metacognitive-guard/agents/impl-reviewer.md
  • plugins/otelwiki/agents/otel-guide.md
  • plugins/otelwiki/hooks/hooks.json
  • plugins/otelwiki/scripts/check-freshness.sh
  • plugins/metacognitive-guard/agents/arch-reviewer.md
  • plugins/ancplua-docs-librarian/hooks/hooks.json
🔇 Additional comments (15)
plugins/otelwiki/agents/otel-guide.md (1)

4-10: LGTM! Tools array format fixed and model upgraded.

The conversion from string to proper YAML array format resolves the plugins stuck in "installed" state issue. The addition of WebSearch and WebFetch tools, combined with the opus model upgrade, enables the enhanced version-checking capabilities described in the PR objectives.

plugins/ancplua-docs-librarian/.claude-plugin/plugin.json (1)

14-15: LGTM! Hooks property added correctly.

The addition of the "hooks" property with the relative path "./hooks/hooks.json" follows the same pattern used in other plugins (e.g., metacognitive-guard). JSON syntax is valid and the structure complies with plugin manifest requirements.

plugins/metacognitive-guard/.claude-plugin/plugin.json (1)

27-28: LGTM! Hooks declaration added.

The hooks property addition follows the established pattern and is syntactically correct.

plugins/metacognitive-guard/agents/arch-reviewer.md (2)

7-12: LGTM! Model upgraded and WebSearch tool added.

The opus model upgrade and WebSearch addition align with the PR's goal of improving reasoning capabilities and enabling real-time pattern verification. The YAML array format is correct.


91-105: Excellent WebSearch guidance section.

The new section provides clear, actionable guidance on when to use WebSearch, complete with relevant examples and site-specific search patterns. The directive to verify rather than guess architecture patterns strengthens the review quality and reduces potential hallucinations.

The example searches demonstrating site:learn.microsoft.com usage are particularly helpful for ensuring authoritative sources.

plugins/ancplua-docs-librarian/hooks/hooks.json (1)

1-14: The nested "hooks" structure is the standard pattern in this repository.

All hooks.json files across the plugins (ancplua-docs-librarian, dotnet-architecture-lint, metacognitive-guard, otelwiki) follow the same two-level nesting: root "hooks" object containing event types (SessionStart, PostToolUse, etc.), with an inner "hooks" array holding the actual hook definitions. This consistent structure is clearly intentional and represents the expected schema for Claude plugins in this codebase.

plugins/metacognitive-guard/agents/impl-reviewer.md (1)

7-12: LGTM! Model upgrade and Glob tool addition enhance capabilities.

The upgrade to opus and addition of Glob tool are appropriate for the implementation reviewer's fact-checking and code discovery needs. The YAML tools array format is correct.

plugins/ancplua-docs-librarian/agents/ancplua-librarian.md (3)

4-10: LGTM! Tools format fixed and web capabilities added.

The conversion to YAML array format resolves the plugin installation issue mentioned in the PR objectives. The addition of WebSearch and WebFetch aligns with the freshness-checking workflow, and the opus model upgrade enhances the librarian's reasoning capabilities.


201-210: LGTM! Clear guidance on web capabilities.

The Web Capabilities section provides clear guidance on when to use WebSearch/WebFetch and appropriately distinguishes between local repositories (development source of truth) and NuGet (consumer source of truth). This aligns well with the freshness-checking workflow introduced in this PR.


161-181: NuGet endpoints and package versions are current and valid.

The xUnit v3 and xunit.v3.mtp-v2 package versions (3.2.1) are currently the latest stable releases. The NuGet API endpoints are correctly formatted and functional. The technical guidance—OutputType=Exe, MTP v2 adapter requirement, and dotnet run for execution—is accurate. No changes needed.

plugins/otelwiki/.claude-plugin/plugin.json (1)

16-17: LGTM! Hooks declaration properly added.

The hooks field correctly references ./hooks/hooks.json and the JSON syntax is valid with proper comma placement.

plugins/otelwiki/agents/otel-librarian.md (1)

4-12: LGTM! Tools format corrected and capabilities enhanced.

The YAML array format is correct and resolves the installation issue. The addition of WebFetch and WebSearch enables the librarian to perform version checks and freshness validation as described in the PR objectives. The opus model upgrade enhances the agent's reasoning capabilities for complex documentation sync operations.

plugins/otelwiki/scripts/check-freshness.sh (1)

2-3: Clear design rationale.

The comment explains the simplified approach well—always offering a sync opportunity at session start is a reasonable UX choice for freshness checks.

CHANGELOG.md (2)

28-34: Well-documented changes.

The changelog entry accurately captures the YAML format fix, tool additions, and model upgrades. The list of affected agents provides clear traceability.


40-47: Comprehensive freshness hooks documentation.

The entry clearly explains the SessionStart hook behavior, trigger conditions, and the value proposition of preventing outdated suggestions. The specific implementations for each plugin provide good detail.

@ANcpLua ANcpLua merged commit e5d21cf into main Jan 6, 2026
36 of 39 checks passed
@ANcpLua ANcpLua deleted the fix/plugin-agents-freshness-hooks branch January 6, 2026 01:28
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