Skip to content

Add Doc Detective MCP server integration#27

Merged
hawkeyexl merged 5 commits into
mainfrom
claude/peaceful-leakey-710728
May 3, 2026
Merged

Add Doc Detective MCP server integration#27
hawkeyexl merged 5 commits into
mainfrom
claude/peaceful-leakey-710728

Conversation

@hawkeyexl
Copy link
Copy Markdown
Contributor

@hawkeyexl hawkeyexl commented May 2, 2026

Summary

Auto-registers the new remote MCP server at https://agency.doc-detective.com/mcp (live now) across every host that supports it. Closes the gap for users on hosts without skills/plugins, and lets shipping skills delegate detection and validation to a single hosted source of truth instead of duplicating local Node logic.

The server exposes three tools:

  • detect_tests — parse doc content into a resolved test plan (wraps doc-detective-common.detectTests)
  • validate_spec — schema-validate spec/config/test/step/context objects (wraps doc-detective-common.validate)
  • log_observation — anonymous, agent-initiated feedback channel that never carries user content

What changed

Auto-bundled host registrations (no user setup needed)

Host File Shape
Claude Code plugins/doc-detective/.claude-plugin/plugin.json mcpServers with type: "http", headers["X-DD-Client"]="claude-code"
Gemini CLI gemini-extension.json mcpServers with httpUrl (not url), X-DD-Client="gemini-cli"
Qwen Code qwen-extension.json (new) mirrors Gemini, X-DD-Client="qwen-code"
OpenCode src/hooks/opencode-plugin.mjs hand-edited mcp block with type: "remote", X-DD-Client="opencode"

A canonical src/mcp-servers.json registry plus a new syncMcpServers() step in build.js fans the entry out into the per-host shapes. Idempotent, verified across two consecutive builds.

Documented manual setup

Cursor, Codex, and Copilot CLI manage MCP in user-level config files outside the plugin/extension package, so README ships a paste-ready snippet for each (Cursor → .cursor/mcp.json, Codex → ~/.codex/config.toml, Copilot CLI → ~/.copilot/mcp-config.json).

Skill updates — MCP-preferred fallback

Three skills now prefer MCP tools when registered, falling back to local Node scripts otherwise:

  • doc-detective-validatevalidate_spec
  • doc-detective-generatedetect_tests (Step 0) + validate_spec (Step 3)
  • doc-detective-doc-testing → both, for detection and validation paths

Cross-host tool naming (mcp__doc-detective__validate_spec in Claude Code vs bare validate_spec elsewhere) and log_observation usage rules are centralized in a new src/skills/_shared/MCP-USAGE.md reference doc.

log_observation is skill-only

Per the PRD's privacy guardrails, log_observation must never carry user content (file paths, URLs, selectors, spec bodies). Hooks fire deterministically per file edit and have access to file_path — wiring telemetry from there is high leak risk. Keeping log_observation skill-only puts the LLM in the loop to produce sanitized abstract messages.

Versioning

Bumps 1.3.01.4.0 (minor, additive).

Incidental fixes folded in

  • .husky/pre-commit — rewrote to a verify-only check. The previous hook ran git add from inside pre-commit, which fails because the outer commit holds the index lock (latent on Linux too — only worked when builds were no-ops). New hook runs the build and exits non-zero if any artifact drifted, prompting npm run build and re-stage. Now also covers qwen-extension.json.
  • tests/hooks/codex-plugin.test.js — skip leading-underscore directories so the new _shared/ namespace doesn't trip the "every skill dir has SKILL.md" assertion.

Test plan

  • npm run build:no-scripts — exits clean
  • Build idempotency — two consecutive builds produce identical artifacts (md5 match)
  • npm run test:hooks — 52/53 pass; 1 pre-existing failure on session-start-check-install ENOENT (no hook scripts modified)
  • npm run test:codex-plugin — 15/15 pass after the _shared/ test fix
  • npm run test:hooks:integration — 3/4 pass; 1 pre-existing failure on Hook 5 auto-format (no hook scripts modified)
  • JSON syntax — node -e JSON.parse(...) clean for all manifests, marketplace files, mcp-servers.json
  • OpenCode JS — node --check clean
  • Per-host schema correctness — Claude Code uses type:"http" + url; Gemini/Qwen use httpUrl; OpenCode uses type:"remote"; X-DD-Client set correctly per host
  • README manual snippets — Cursor (JSON), Codex (TOML), Copilot CLI (JSON) parse and contain the right URL + X-DD-Client
  • Smoke test in Claude Code: install plugin from local marketplace, run /mcp, confirm doc-detective listed and tools surface as mcp__doc-detective__detect_tests / mcp__doc-detective__validate_spec / mcp__doc-detective__log_observation
  • Smoke test in Gemini CLI: install extension, run /mcp, confirm doc-detective listed
  • Smoke test in OpenCode: install plugin, confirm doc-detective MCP server listed
  • Manual snippet sanity check (Cursor, Codex, Copilot CLI): paste, verify host lists doc-detective

Notes for reviewers

  • The README has unresolved git merge conflict markers from PRs Add OpenCode plugin #15 and Add Codex plugin and clarify assertion model scope #17 (lines ~86–137, 281–285, 396–400 of pre-PR README). Out of scope for this PR — the user requested a separate cleanup PR.
  • package.json's validate:skills script points to ./scripts/doc-detective-validate-skills.sh but the actual file is scripts/validate-skills.sh. Pre-existing path mismatch, not touched here.
  • The pre-existing hook test failures (session-start-check-install ENOENT, post-edit-format-test-spec integration) reproduce on a clean stash and are unrelated to MCP work.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Integrated MCP server support with three remote tools: test detection, specification validation, and observation logging; auto-registration for supported hosts.
  • Documentation

    • Added MCP server usage, privacy details, Codex installation steps, and updated skill workflows to prefer MCP tools with fallbacks.
  • Chores

    • Bumped release version to 1.4.0.
    • Strengthened pre-commit hook to verify build-artifact drift without mutating the index.
  • Tests

    • Updated test collection to ignore underscore-prefixed shared directories.

Auto-register the new remote MCP server at https://agency.doc-detective.com/mcp
across all hosts that support it, so users get detect_tests, validate_spec,
and log_observation tools without manual setup.

Single source of truth: src/mcp-servers.json. build.js fans the entry out
into per-host shapes:

- Claude Code     plugins/doc-detective/.claude-plugin/plugin.json (mcpServers)
- Gemini CLI      gemini-extension.json (mcpServers, httpUrl)
- Qwen Code       qwen-extension.json (new, mcpServers, httpUrl)
- OpenCode        src/hooks/opencode-plugin.mjs (mcp block, hand-edited)

Each host gets a distinct X-DD-Client header for telemetry attribution.
Cursor, Codex, and Copilot CLI manage MCP in user-level config files
outside the plugin/extension package, so README documents the exact
snippet to paste for each.

Skills updated to prefer MCP tools when registered, fall back to local
Node scripts otherwise:

- doc-detective-validate     -> validate_spec
- doc-detective-generate     -> detect_tests + validate_spec
- doc-detective-doc-testing  -> detect_tests + validate_spec

New shared reference src/skills/_shared/MCP-USAGE.md covers cross-host
tool naming and usage rules for log_observation. Critically,
log_observation is exposed via skills only -- never from hooks -- to keep
the LLM in the loop for sanitized abstract feedback (the PRD prohibits
sending file paths, URLs, selectors, or spec contents).

Bumps version 1.3.0 -> 1.4.0 (minor, additive).

Incidental fixes folded in:

- .husky/pre-commit: rewrite to a verify-only check. The previous hook
  ran 'git add' inside pre-commit, which fails because the outer commit
  holds the index lock. The new hook runs the build and exits non-zero
  if any artifact under agents/, skills/, src/hooks/, hooks/, commands/,
  plugins/doc-detective/, .claude-plugin/marketplace.json,
  gemini-extension.json, or qwen-extension.json drifted -- prompting
  the developer to run 'npm run build' and stage the results.
- tests/hooks/codex-plugin.test.js: skip leading-underscore directories
  so the new _shared/ namespace doesn't trip the "every skill dir has
  SKILL.md" assertion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 2, 2026 22:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@hawkeyexl has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 17 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 735befe8-1f5d-405c-a654-aee2a0c36aae

📥 Commits

Reviewing files that changed from the base of the PR and between ce1112c and d4ad6e8.

⛔ Files ignored due to path filters (4)
  • commands/doc-detective-generate.md is excluded by !commands/**
  • commands/doc-detective-generate.toml is excluded by !commands/**
  • plugins/doc-detective/skills/doc-detective-generate/SKILL.md is excluded by !plugins/**
  • skills/doc-detective-generate/SKILL.md is excluded by !skills/**
📒 Files selected for processing (2)
  • build.js
  • src/skills/doc-detective-generate/SKILL.md
📝 Walkthrough

Walkthrough

Adds a Doc Detective MCP server registry and build sync to distribute MCP configurations to host manifests, auto-registers the MCP in OpenCode plugin, updates manifests and many skill docs to v1.4.0, and refactors the pre-commit hook to verification-only drift checks.

Changes

MCP Server Infrastructure & Version 1.4.0 Release

Layer / File(s) Summary
Data Shape / Registry
src/mcp-servers.json
New canonical MCP registry entry doc-detective with url, description, enabled, and clientNames mappings.
Build Orchestration
build.js
Adds syncMcpServers() to read src/mcp-servers.json, compute mcpServers blocks for hosts, update/delete host manifest mcpServers, and calls it after syncVersions(); also updates qwen-extension.json only when present.
Host Manifests
gemini-extension.json, qwen-extension.json, .../.claude-plugin/marketplace.json, package.json
Bumped versions to 1.4.0 where present; added/updated qwen-extension.json with mcpServers.doc-detective (httpUrl and X-DD-Client: qwen-code).
Plugin Wiring
src/hooks/opencode-plugin.mjs
Plugin now returns an auto-registered mcp block registering doc-detective (remote URL, enabled, X-DD-Client: "opencode"), exposing detect_tests, validate_spec, log_observation.
Skills / Workflows
src/skills/.../SKILL.md
Multiple skills updated to prefer MCP-first flows: use detect_tests and validate_spec (with shapes like schemaKey: "spec_v3", addDefaults: true), with explicit fallbacks and result interpretation guidance.
Shared Docs
src/skills/_shared/MCP-USAGE.md, README.md
New MCP usage guide and README additions describing MCP endpoint, tools, auto-registration snippets for hosts, and privacy notes.
Metadata Sync
.claude-plugin/marketplace.json, src/agents/doc-detective-specialist.md, src/skills/*/SKILL.md
Version/date bumped to 1.4.0/May 2026 across agent and skill metadata and plugin marketplace entry.

Build Verification & Pre-commit Hook Refactoring

Layer / File(s) Summary
Pre-commit Hook Logic
.husky/pre-commit
Replaces auto-staging behavior with verification-only script: runs npm run build --silent, defines ARTIFACT_PATHS, checks for tracked (git diff --name-only) and untracked (git ls-files --others) artifact drift, prints drifted paths and exits 1 if out-of-date.
Tests / Filtering
tests/hooks/codex-plugin.test.js
Test for Codex plugin skills directory updated to exclude _-prefixed directories when collecting skill folders (e.isDirectory() && !e.name.startsWith('_')).

Sequence Diagram(s)

sequenceDiagram
    participant Build as Build System
    participant Registry as src/mcp-servers.json
    participant Manifests as Host Manifests
    participant Plugin as OpenCode Plugin
    participant Skills as Skill Workflows
    participant MCP as Remote MCP Server

    Build->>Registry: Read enabled servers + client mappings
    Registry-->>Build: doc-detective config
    Build->>Manifests: Compute/write mcpServers blocks (Claude/Gemini/Qwen)
    Manifests-->>Build: Updated manifests
    Build->>Plugin: Ensure plugin mcp block (auto-register)
    Plugin-->>Manifests: Exposes MCP to OpenCode host
    Skills->>MCP: Call detect_tests / validate_spec (when available)
    MCP-->>Skills: Return tests / validation results
    alt MCP Available
        Skills->>Skills: Use MCP results (proceed)
    else MCP Unavailable
        Skills->>Skills: Run local fallback flows
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jstjoe

Poem

🐇 I hopped to the registry, keys in paw,

servers lined up, all tidy and raw.
Hooks now watch, they do not rearrange,
Skills ask the cloud, then fall back when strange.
Version bumped—Doc Detective’s new page!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Doc Detective MCP server integration' clearly summarizes the main change: introducing MCP server integration for the Doc Detective tool.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/peaceful-leakey-710728

Tip

💬 Introducing Slack Agent: Turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).


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
Review rate limit: 0/1 reviews remaining, refill in 53 minutes and 17 seconds.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a hosted Doc Detective MCP server integration and propagates its registration into each supported host manifest, while updating skills/commands to prefer MCP tools (with local fallbacks) and bumping the repo version to 1.4.0.

Changes:

  • Introduces src/mcp-servers.json as a canonical MCP server registry and adds a syncMcpServers() build step to fan it out into host-specific config shapes.
  • Auto-registers the remote MCP server in Claude plugin + Gemini/Qwen extensions + OpenCode plugin, and documents manual setup snippets in the README for other hosts.
  • Updates skills/commands to prefer MCP tools (detect_tests, validate_spec) when available, adds shared _shared/MCP-USAGE.md, and adjusts the Codex plugin test to ignore _shared/.

Reviewed changes

Copilot reviewed 50 out of 50 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/hooks/codex-plugin.test.js Skips _-prefixed directories (e.g. _shared/) in skills directory assertions.
src/skills/doc-detective-validate/SKILL.md Prefers MCP validate_spec with fallback to local validation; bumps version/date.
src/skills/doc-detective-test/SKILL.md Bumps version/date.
src/skills/doc-detective-project-bootstrap/SKILL.md Bumps version/date.
src/skills/doc-detective-install-github-action/SKILL.md Bumps version/date.
src/skills/doc-detective-inline-test-injection/SKILL.md Bumps version/date.
src/skills/doc-detective-inject/SKILL.md Bumps version/date.
src/skills/doc-detective-init/SKILL.md Bumps version/date.
src/skills/doc-detective-generate/SKILL.md Prefers MCP detect_tests + validate_spec with fallback; bumps version/date.
src/skills/doc-detective-doc-testing/SKILL.md Prefers MCP detection/validation with fallback; bumps version/date.
src/skills/_shared/MCP-USAGE.md Adds shared MCP usage guidance (tool naming + privacy rules).
src/mcp-servers.json Adds canonical MCP server registry entry for doc-detective.
src/hooks/opencode-plugin.mjs Auto-registers remote MCP server in OpenCode plugin return object.
src/agents/doc-detective-specialist.md Bumps version/date.
skills/doc-detective-validate/SKILL.md Built artifact mirror of src skill updates (MCP-preferred validation + metadata bump).
skills/doc-detective-test/SKILL.md Built artifact metadata bump.
skills/doc-detective-project-bootstrap/SKILL.md Built artifact metadata bump.
skills/doc-detective-install-github-action/SKILL.md Built artifact metadata bump.
skills/doc-detective-inline-test-injection/SKILL.md Built artifact metadata bump.
skills/doc-detective-inject/SKILL.md Built artifact metadata bump.
skills/doc-detective-init/SKILL.md Built artifact metadata bump.
skills/doc-detective-generate/SKILL.md Built artifact MCP-preferred generate flow + metadata bump.
skills/doc-detective-doc-testing/SKILL.md Built artifact MCP-preferred doc-testing flow + metadata bump.
skills/_shared/MCP-USAGE.md Built artifact mirror of shared MCP usage doc.
qwen-extension.json Adds Qwen extension manifest with MCP server registration.
plugins/doc-detective/skills/doc-detective-validate/SKILL.md Plugin artifact mirror of MCP-preferred validation + metadata bump.
plugins/doc-detective/skills/doc-detective-test/SKILL.md Plugin artifact metadata bump.
plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md Plugin artifact metadata bump.
plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md Plugin artifact metadata bump.
plugins/doc-detective/skills/doc-detective-inline-test-injection/SKILL.md Plugin artifact metadata bump.
plugins/doc-detective/skills/doc-detective-inject/SKILL.md Plugin artifact metadata bump.
plugins/doc-detective/skills/doc-detective-init/SKILL.md Plugin artifact metadata bump.
plugins/doc-detective/skills/doc-detective-generate/SKILL.md Plugin artifact MCP-preferred generate flow + metadata bump.
plugins/doc-detective/skills/doc-detective-doc-testing/SKILL.md Plugin artifact MCP-preferred doc-testing flow + metadata bump.
plugins/doc-detective/skills/_shared/MCP-USAGE.md Plugin artifact mirror of shared MCP usage doc.
plugins/doc-detective/opencode-plugin.mjs Plugin artifact mirror of OpenCode MCP auto-registration block.
plugins/doc-detective/agents/doc-detective-specialist.md Plugin artifact metadata bump + assertion model wording update.
plugins/doc-detective/.codex-plugin/plugin.json Bumps plugin version to 1.4.0.
plugins/doc-detective/.claude-plugin/plugin.json Adds mcpServers registration + bumps version.
package.json Bumps package version to 1.4.0.
gemini-extension.json Adds mcpServers registration + bumps version.
commands/doc-detective-validate.toml Command prompt updated to prefer MCP validation (generated).
commands/doc-detective-validate.md Command prompt updated to prefer MCP validation (generated).
commands/doc-detective-generate.toml Command prompt updated to prefer MCP detection/validation (generated).
commands/doc-detective-generate.md Command prompt updated to prefer MCP detection/validation (generated).
build.js Adds syncMcpServers() to stamp MCP registrations into host configs; adds qwen version sync.
agents/doc-detective-specialist.md Built artifact metadata bump.
README.md Documents MCP server, auto-registered hosts, and manual config snippets + privacy note.
.husky/pre-commit Switches to verify-only build drift check (no git add), includes Qwen artifact path.
.claude-plugin/marketplace.json Bumps marketplace version to 1.4.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build.js Outdated
The previous comment told readers to hand-edit
plugins/doc-detective/opencode-plugin.mjs, but that's a generated artifact
that syncHooks() overwrites on every build. Point at
src/hooks/opencode-plugin.mjs (source of truth) and note that the artifact
copy is regenerated on build.

Per Copilot review on PR #27.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

86-137: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Resolve unresolved merge conflict markers in README before merge.

Lines in these ranges still include <<<<<<<, =======, and >>>>>>>, leaving contradictory instructions in user-facing install docs.

Also applies to: 281-285, 454-458

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 86 - 137, The README contains unresolved Git merge
conflict markers (<<<<<<<, =======, >>>>>>>) around the "OpenCode"/"Codex"
installation sections and "Cursor, OpenCode, and other agents" heading; open the
README, remove the conflict markers, choose and consolidate the correct content
for the installation steps and headings (e.g., keep the intended plugin install
instructions and the correct section title), and ensure the final text is a
single coherent set of instructions (verify other reported ranges ~281-285 and
~454-458 for similar markers) so no conflict markers remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.husky/pre-commit:
- Around line 12-18: The pre-commit drift check only looks at tracked diffs via
"git diff --quiet -- $ARTIFACT_PATHS" and so misses newly created/untracked
build artifacts; update the check to also detect untracked files by testing the
output of "git ls-files -o --exclude-standard -- $ARTIFACT_PATHS" (or "git
status --porcelain -- $ARTIFACT_PATHS" and look for lines prefixed with "??"),
e.g. change the if-condition to fail when either git diff shows changes or git
ls-files -o returns any paths, and update the "Drifted paths:" reporting
(currently using "git diff --name-only -- $ARTIFACT_PATHS | sed 's/^/  /'") to
also include untracked artifact names from "git ls-files -o --exclude-standard
-- $ARTIFACT_PATHS".

In `@src/skills/doc-detective-generate/SKILL.md`:
- Around line 60-66: The fenced code block showing the detect_tests example in
SKILL.md lacks a language tag triggering markdownlint MD040; update that fence
to include a language (e.g., "javascript") so the block begins with
```javascript and keep the existing detect_tests({...}) content unchanged—look
for the detect_tests example block in SKILL.md and add the language identifier
to the opening triple backticks.

In `@src/skills/doc-detective-validate/SKILL.md`:
- Around line 71-78: The fenced code block showing the validate_spec usage in
SKILL.md lacks a language tag; update the opening fence for that block to
include a language (e.g., change the triple backtick to ```javascript) so
markdownlint MD040 is satisfied and the snippet is syntax-highlighted for
validate_spec({...}).

---

Outside diff comments:
In `@README.md`:
- Around line 86-137: The README contains unresolved Git merge conflict markers
(<<<<<<<, =======, >>>>>>>) around the "OpenCode"/"Codex" installation sections
and "Cursor, OpenCode, and other agents" heading; open the README, remove the
conflict markers, choose and consolidate the correct content for the
installation steps and headings (e.g., keep the intended plugin install
instructions and the correct section title), and ensure the final text is a
single coherent set of instructions (verify other reported ranges ~281-285 and
~454-458 for similar markers) so no conflict markers remain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 435d8584-56dc-4ae6-a4cc-9580f78e05d1

📥 Commits

Reviewing files that changed from the base of the PR and between 6e741c3 and 1028fce.

⛔ Files ignored due to path filters (29)
  • agents/doc-detective-specialist.md is excluded by !agents/**
  • commands/doc-detective-generate.md is excluded by !commands/**
  • commands/doc-detective-generate.toml is excluded by !commands/**
  • commands/doc-detective-validate.md is excluded by !commands/**
  • commands/doc-detective-validate.toml is excluded by !commands/**
  • plugins/doc-detective/.claude-plugin/plugin.json is excluded by !plugins/**
  • plugins/doc-detective/.codex-plugin/plugin.json is excluded by !plugins/**
  • plugins/doc-detective/agents/doc-detective-specialist.md is excluded by !plugins/**
  • plugins/doc-detective/opencode-plugin.mjs is excluded by !plugins/**
  • plugins/doc-detective/skills/_shared/MCP-USAGE.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-doc-testing/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-generate/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-init/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-inject/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-inline-test-injection/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-test/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-validate/SKILL.md is excluded by !plugins/**
  • skills/_shared/MCP-USAGE.md is excluded by !skills/**
  • skills/doc-detective-doc-testing/SKILL.md is excluded by !skills/**
  • skills/doc-detective-generate/SKILL.md is excluded by !skills/**
  • skills/doc-detective-init/SKILL.md is excluded by !skills/**
  • skills/doc-detective-inject/SKILL.md is excluded by !skills/**
  • skills/doc-detective-inline-test-injection/SKILL.md is excluded by !skills/**
  • skills/doc-detective-install-github-action/SKILL.md is excluded by !skills/**
  • skills/doc-detective-project-bootstrap/SKILL.md is excluded by !skills/**
  • skills/doc-detective-test/SKILL.md is excluded by !skills/**
  • skills/doc-detective-validate/SKILL.md is excluded by !skills/**
📒 Files selected for processing (21)
  • .claude-plugin/marketplace.json
  • .husky/pre-commit
  • README.md
  • build.js
  • gemini-extension.json
  • package.json
  • qwen-extension.json
  • src/agents/doc-detective-specialist.md
  • src/hooks/opencode-plugin.mjs
  • src/mcp-servers.json
  • src/skills/_shared/MCP-USAGE.md
  • src/skills/doc-detective-doc-testing/SKILL.md
  • src/skills/doc-detective-generate/SKILL.md
  • src/skills/doc-detective-init/SKILL.md
  • src/skills/doc-detective-inject/SKILL.md
  • src/skills/doc-detective-inline-test-injection/SKILL.md
  • src/skills/doc-detective-install-github-action/SKILL.md
  • src/skills/doc-detective-project-bootstrap/SKILL.md
  • src/skills/doc-detective-test/SKILL.md
  • src/skills/doc-detective-validate/SKILL.md
  • tests/hooks/codex-plugin.test.js

Comment thread .husky/pre-commit Outdated
Comment thread src/skills/doc-detective-generate/SKILL.md Outdated
Comment thread src/skills/doc-detective-validate/SKILL.md Outdated
- .husky/pre-commit: catch untracked artifacts too. The previous drift
  check used `git diff --quiet` which only sees tracked diffs, so a
  newly created build artifact (e.g. a fresh file under commands/)
  could bypass the guard. Now also runs
  `git ls-files --others --exclude-standard` and fails on either
  tracked or untracked drift, listing both in the error output.
- src/skills/doc-detective-generate/SKILL.md: add 'javascript'
  language tag to the detect_tests example fence (markdownlint MD040).
- src/skills/doc-detective-validate/SKILL.md: same MD040 fix for the
  validate_spec example fence.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hawkeyexl
Copy link
Copy Markdown
Contributor Author

@coderabbitai re: the outside-diff comment about README merge conflict markers (lines ~86-137, 281-285, 454-458): those are pre-existing artifacts from PRs #15 and #17 and are intentionally left untouched in this PR per the PR description's "Notes for reviewers" section. They'll be addressed in a separate cleanup PR to keep this one focused on the MCP integration. CC'ing for visibility — feel free to flag again if you'd like them folded in.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

Tip

For best results, initiate chat on the files or code changes.

@hawkeyexl: Understood — thanks for the context! I'll treat those conflict markers as pre-existing and out of scope for this PR. I'll hold off re-flagging them here and look forward to the cleanup PR.


✏️ Learnings added
Learnt from: hawkeyexl
URL: https://github.com/doc-detective/agent-tools/pull/27

Timestamp: 2026-05-02T23:05:34.495Z
Learning: In the `doc-detective/agent-tools` repository, the README.md contains pre-existing merge conflict markers at approximately lines 86-137, 281-285, and 454-458. These are leftover artifacts from PRs `#15` and `#17`, are intentionally left untouched in PRs focused on other features, and will be resolved in a dedicated cleanup PR. Do not flag these markers as issues in unrelated PRs.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@hawkeyexl
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 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.

Copy link
Copy Markdown
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build.js`:
- Around line 277-297: The loop over registry entries assumes each spec is a
well-formed object with a url and optional clientNames; validate each entry
(registry[key] / spec) before writing to claudeBlock, geminiBlock and qwenBlock:
check that spec is an object, spec.url is a non-empty string, and if present
spec.clientNames is an object; if validation fails, throw or log a clear error
and skip/fail early so invalid entries cannot produce bad host manifests; add
the checks immediately before computing
clientNames/claudeClient/geminiClient/qwenClient in the for (const [name, spec]
of Object.entries(registry)) loop.
- Around line 264-267: The build currently silently skips when the canonical
registry file is missing by checking fs.existsSync(registryPath) and calling
log(...) then return; change this to fail-fast: when registryPath
(src/mcp-servers.json) does not exist, throw an Error or call process.exit(1) so
the build fails immediately (include a clear message like "Missing
src/mcp-servers.json - aborting build"). Update the block that references
fs.existsSync(registryPath) and remove the silent log/return to ensure
mcpServers can't remain stale in generated manifests.

In `@src/skills/doc-detective-generate/SKILL.md`:
- Around line 68-69: Clarify the handoff shape from detect_tests to the Validate
step by stating that the output should be wrapped as an object with a "tests"
key (i.e., { "tests": [...] }) so Step 3's validator receives that exact shape;
mention detect_tests, the "tests" array, and the Validate step (or validator)
and update the wording around Line 68 and Line 99 to explicitly instruct
consumers to pass the returned tests as { "tests": [...] } to avoid validation
loops and ambiguity with doc-detective-common semantics.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5386796c-fc10-4fb7-8600-2421d0f464ef

📥 Commits

Reviewing files that changed from the base of the PR and between 1028fce and ce1112c.

⛔ Files ignored due to path filters (8)
  • commands/doc-detective-generate.md is excluded by !commands/**
  • commands/doc-detective-generate.toml is excluded by !commands/**
  • commands/doc-detective-validate.md is excluded by !commands/**
  • commands/doc-detective-validate.toml is excluded by !commands/**
  • plugins/doc-detective/skills/doc-detective-generate/SKILL.md is excluded by !plugins/**
  • plugins/doc-detective/skills/doc-detective-validate/SKILL.md is excluded by !plugins/**
  • skills/doc-detective-generate/SKILL.md is excluded by !skills/**
  • skills/doc-detective-validate/SKILL.md is excluded by !skills/**
📒 Files selected for processing (5)
  • .husky/pre-commit
  • README.md
  • build.js
  • src/skills/doc-detective-generate/SKILL.md
  • src/skills/doc-detective-validate/SKILL.md
✅ Files skipped from review due to trivial changes (2)
  • src/skills/doc-detective-validate/SKILL.md
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .husky/pre-commit

Comment thread build.js
Comment thread build.js
Comment thread src/skills/doc-detective-generate/SKILL.md Outdated
- build.js: hard-fail when src/mcp-servers.json is missing instead of
  silently skipping. The previous behavior could leave stale mcpServers
  blocks in generated host manifests if the registry file was lost or
  not yet committed.
- build.js: validate each registry entry shape before writing host
  configs. Throw a clear error if the entry isn't an object, if its
  `url` isn't a non-empty string, or if `clientNames` is present but
  not an object. This keeps malformed entries from producing broken
  host registrations.
- src/skills/doc-detective-generate/SKILL.md: clarify the handoff shape
  from `detect_tests` to `validate_spec`. The MCP detect_tests result
  has shape {tests[], detectedFileType, warnings[]}, but `validate_spec`
  with `schemaKey: "spec_v3"` expects an object shaped { "tests": [...] }.
  Step 0 now spells out building `<generated-spec>` as
  { "tests": <returned-tests-array> }, and Step 3 reiterates the
  expected shape. Avoids needless validation loops.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hawkeyexl hawkeyexl merged commit c62aae8 into main May 3, 2026
3 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.

2 participants