Skip to content

fix(plugin): make plugin.json compatible with Claude Code 2.1.x schema#4

Open
hodoolisence-lab wants to merge 1 commit into
dreamrec:mainfrom
hodoolisence-lab:fix/plugin-manifest-cc21
Open

fix(plugin): make plugin.json compatible with Claude Code 2.1.x schema#4
hodoolisence-lab wants to merge 1 commit into
dreamrec:mainfrom
hodoolisence-lab:fix/plugin-manifest-cc21

Conversation

@hodoolisence-lab

Copy link
Copy Markdown

What

  • agents: directory string "./agents/" → explicit array of the four agent file paths.
  • Remove hooks (./hooks/hooks.json) and mcpServers (./.mcp.json) declarations — both live at the conventional paths that Claude Code auto-loads.

Why

On Claude Code 2.1.x, claude plugin install tdpilot@dreamrec-TDPilot fails in two stages:

  1. agents: Invalid input — the current plugin manifest schema expects agents to be an array of file paths. A directory string is rejected. (skills still accepts a directory string, which is why only agents trips here.)

  2. After fixing (1), the plugin installs but fails to load:

    Hook load failed: Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded file ... The standard hooks/hooks.json is loaded automatically, so manifest.hooks should only reference additional hook files.

    The conventional root .mcp.json is auto-discovered the same way, so mcpServers is removed alongside hooks to avoid the equivalent duplicate.

Verification

  • claude plugin install tdpilot@dreamrec-TDPilot → success; claude plugin list✓ enabled.
  • All 8 skills, 4 agents, and 2 commands (/td-check, /td-snapshot) load.
  • uv run tdpilot doctor → all PASS, tool_count_drift: registry=manifest=110.

Note for maintainers

Removing hooks/mcpServers relies on Claude Code auto-discovering the conventional ./hooks/hooks.json and ./.mcp.json. If you need to support older Claude Code versions that required explicit declaration, keep them only where auto-discovery isn't available. Tested on Claude Code 2.1.150.

🤖 Generated with Claude Code

`claude plugin install tdpilot@dreamrec-TDPilot` fails on Claude Code 2.1.x:

1. `agents: Invalid input` — the manifest schema expects `agents` as an
   array of file paths; a directory string ("./agents/") is rejected.
   (`skills` still accepts a directory string.)
2. After fixing (1), loading fails with "Duplicate hooks file detected:
   ./hooks/hooks.json ... The standard hooks/hooks.json is loaded
   automatically." The conventional root .mcp.json is auto-loaded the
   same way, so both `hooks` and `mcpServers` declarations are removed
   and left to auto-discovery.

After this change the plugin installs and shows enabled; all 8 skills,
4 agents and 2 commands load, and `uv run tdpilot doctor` passes with
registry=manifest=110 tools.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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