fix(pr-review): rename .agents/ → agents/ so plugin agents are discoverable#38
Merged
Merged
Conversation
Track the .agents/ → agents/ rename fix and name: frontmatter addition needed to make pr-review plugin agents discoverable by Claude Code's agent auto-discovery system. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ugin agents Claude Code's agent auto-discovery scans agents/ (no dot prefix). The plugin used .agents/ (hidden dir), which was never scanned, causing "Agent type 'pr-review:ado-fetcher' not found" at runtime. Also adds name: frontmatter field to all five agent files to match the convention used by pr-review-toolkit (defensive hardening). Fixes: .agents/ → agents/ rename, name: field, CLAUDE.md layout, ADR 0013 correction, test path references, plugin-structure test suite. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These implementation-notes files were untracked while hidden under .agents/ and got accidentally indexed during the rename. Remove them from the tree; the directory remains on disk for agent use. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
.agents/scratchpad/ → agents/scratchpad/ in .gitignore to match the renamed agents/ directory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes agent auto-discovery for the apps/claude-code/pr-review plugin by moving agent definitions from a hidden .agents/ directory to a discoverable agents/ directory, aligning the plugin with Claude Code’s expected layout.
Changes:
- Renames the plugin agent directory to
agents/and addsname:to each agent’s YAML frontmatter. - Updates tests and adds a new structural test to prevent regressions in plugin layout/agent frontmatter.
- Updates plugin docs/metadata (CLAUDE.md, ADR 0013, changelog, version bump, .gitignore).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/issues/pr-review-agents-not-discovered/01-rename-agents-dir-and-fix-frontmatter.md | New issue doc capturing the problem, root cause, and acceptance criteria for the rename/frontmatter hardening. |
| apps/claude-code/pr-review/tests/plugin-structure.test.mjs | Adds structural tests asserting agents/ exists, .agents/ does not, and agent frontmatter contains a matching name: field. |
| apps/claude-code/pr-review/tests/ado-writer.test.mjs | Updates test fixture path to read agent markdown from agents/. |
| apps/claude-code/pr-review/tests/ado-fetcher.test.mjs | Updates test fixture path to read agent markdown from agents/. |
| apps/claude-code/pr-review/package.json | Adds the new structural test file to the explicit node --test invocation list. |
| apps/claude-code/pr-review/docs/adr/0013-orchestrator-split-for-review-pr.md | Updates directory name reference; also introduces additional ADR content and references that need follow-up. |
| apps/claude-code/pr-review/CLAUDE.md | Updates repo layout + one prose reference to use agents/ (but still has a remaining .agents/ reference elsewhere). |
| apps/claude-code/pr-review/CHANGELOG.md | Adds 1.2.11 entry describing the rename and frontmatter hardening. |
| apps/claude-code/pr-review/agents/re-review-coordinator.md | Adds name: to agent frontmatter. |
| apps/claude-code/pr-review/agents/doc-context-synthesizer.md | Adds name: to agent frontmatter. |
| apps/claude-code/pr-review/agents/doc-context-orchestrator.md | Adds name: to agent frontmatter. |
| apps/claude-code/pr-review/agents/ado-writer.md | Adds name: to agent frontmatter. |
| apps/claude-code/pr-review/agents/ado-fetcher.md | Adds name: to agent frontmatter. |
| apps/claude-code/pr-review/.gitignore | Updates scratchpad ignore path from .agents/scratchpad/ to agents/scratchpad/. |
| apps/claude-code/pr-review/.claude-plugin/plugin.json | Bumps plugin version to 1.2.11. |
| apps/claude-code/pr-review/.claude-plugin/marketplace.json | Bumps marketplace version to 1.2.11. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- plugin-structure.test.mjs: sort imports (organizeImports) - notices.test.mjs: @ts-ignore → @ts-expect-error (noTsIgnore) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CLAUDE.md: fix remaining .agents/ → agents/ in Command conventions bullet (acceptance criteria gap) - plugin-structure.test.mjs: tighten frontmatter name check from includes() to line-anchored regex — prevents false pass on partial matches like 'name: ado-fetcher-extra' - ADR 0013: revert out-of-scope additions (status 'amended by 0016' and 2026-05-14 update paragraph) — those were pre-existing unstaged changes accidentally staged; they belong in a future PR that also commits ADR 0016 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Claude Code's agent auto-discovery scans an
agents/directory inside each plugin. Thepr-reviewplugin stored its agents in.agents/(dot-prefixed, hidden on Unix), which was never scanned. This caused every spawned sub-agent to fail at runtime:The
pr-review-toolkitplugin — which works correctly — usesagents/(no dot). That mismatch was the root cause.What changed
git mv .agents/ agents/— the directory Claude Code actually scansname: <slug>as the first frontmatter field in all five agent files — defensive hardening to match the workingpr-review-toolkitconventionCLAUDE.mdrepository layout section and ADR 0013 (in-place correction, no new ADR).gitignorescratchpad path (agents/scratchpad/was.agents/scratchpad/).agents/paths intests/ado-fetcher.test.mjsandtests/ado-writer.test.mjstests/plugin-structure.test.mjs— 4 structural tests that go RED with the old layout and GREEN after the rename1.2.11Test plan
pnpm test— 245/245 passingpr-review:ado-fetcher(and the other four agents) appear in the available agent list~/.claude/plugins/cache/unic-agent-plugins/pr-review/1.2.10/.agents/still exists after restart, delete the cache entry or toggle the plugin inenabledPluginsto force a fresh read/pr-review:review-pr <ADO-PR-URL>and confirm the ADO Fetcher launches without "Agent type not found"Closes:
docs/issues/pr-review-agents-not-discovered/01-rename-agents-dir-and-fix-frontmatter.md🤖 Generated with Claude Code