Issue: Silent skill loading failure in plugins, Feature Request: Plugin Manifest Validation with Error Disclosure
Summary
When plugin.json contains unknown fields, Claude Code silently fails to register the plugin's skills. Neither user nor agent receives any indication of the problem, leading to hours of debugging "Unknown skill" errors when the plugin appears to be loaded correctly.
Related Issue
This is an application of the UX principles from #20157 (Better Hook Error Disclosure) to plugin manifest validation.
Current Behavior (Violates P1, P2, P3)
When a plugin's plugin.json contains an unofficial field (e.g., depends-on):
| What happens | User sees | Agent sees |
|--------------|-----------|------------|
| Plugin loads | Plugin in claude plugin list | Plugin appears loaded |
| Skills don't register | Nothing | Nothing |
| User invokes skill | Nothing | "Unknown skill: foo" |
| User debugs | Checks cache, restarts, re-enables | Suggests checking enabledPlugins |
Principle violations:
- P1 (Agent Disclosure): Agent has no information that plugin.json parsing failed
- P2 (User Disclosure): User has no indication anything is wrong
- P3 (Consistency): Both are equally in the dark
The symptom ("Unknown skill") doesn't point to the cause (malformed plugin.json). Users report spending significant time debugging plugin loading, cache issues, and enabledPlugins configuration before discovering the manifest itself was rejected.
Root Cause
Claude Code's plugin.json parser appears to use strict schema validation that rejects plugins with unknown root-level fields. This is reasonable behavior, but the rejection is silent—no error is surfaced anywhere.
Proposed Behavior (Satisfies P1, P2, P3, P4)
At plugin load time, when plugin.json contains unknown fields:
- Log a warning (visible in verbose mode or logs)
- Mark plugin as degraded in
claude plugin list - Surface in
claude /doctorwith actionable guidance
Example disclosure:
# claude plugin list
NAME STATUS
my-plugin@marketplace ⚠️ Warning: manifest has unknown fields
# claude /doctor (or startup warning)
Plugin 'my-plugin' has unknown fields in plugin.json: depends-on
→ Skills from this plugin may not be discoverable
→ Remove unknown fields or move to a separate metadata file
→ See: https://docs.anthropic.com/claude-code/plugins#manifest-schema
Agent disclosure (when "Unknown skill" for a plugin with warnings):
<system-reminder>
Skill 'my-skill' not found. Note: Plugin 'my-plugin' has manifest warnings
(unknown fields: depends-on). This may be why skills aren't registered.
Run `claude /doctor` for details.
</system-reminder>
Applying the UX Principles
| Principle | Current | Proposed |
|-----------|---------|----------|
| P1: Agent Disclosure | ❌ "Unknown skill" (no cause) | ✅ Links "Unknown skill" to manifest warning |
| P2: User Disclosure | ❌ Nothing | ✅ Warning in plugin list, details in /doctor |
| P3: Consistency | ❌ Both blind | ✅ Both receive same core information |
| P4: Audience-Appropriate | N/A | ✅ User: badge + /doctor hint. Agent: structured context |
Minimal Implementation
- During plugin load, catch unknown field errors
- Store warning state on plugin object
- Display warning badge in
plugin list - Add plugin manifest check to
/doctor - When skill lookup fails, check if plugin has warnings and include in error
Benefits
- Surfaces errors at the source rather than downstream symptoms
- Actionable guidance tells user exactly what's wrong and how to fix it
- Backwards compatible - plugins with valid manifests unchanged
- Follows established pattern - similar to how
/doctorsurfaces other configuration issues
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗