Add validation for manifest component existence#891
Conversation
Added a validation feature to check the existence of manifest components on disk and log warnings for missing components.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a manifest-driven validation step when loading a Claude plugin to detect missing component directories early.
Changes:
- Invoke a new
validatePluginStructure()helper before loading agents/commands/skills. - Add
validatePluginStructure()to warn when manifest-declared components don’t exist on disk.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } |
| async function validatePluginStructure(root: string, manifest: ClaudeManifest): Promise<void> { | ||
| const componentsToCheck: Array<{ name: string; declared: any }> = [ | ||
| { name: "agents", declared: manifest.agents }, | ||
| { name: "commands", declared: manifest.commands }, | ||
| { name: "skills", declared: manifest.skills }, | ||
| ] | ||
|
|
||
| for (const { name, declared } of componentsToCheck) { | ||
| if (declared) { | ||
| const dirPath = path.join(root, name) | ||
| const exists = await pathExists(dirPath) | ||
| if (!exists) { | ||
| console.warn(`[Claude Plugin Warning]: "${name}" is defined in manifest but directory missing at: ${dirPath}`) | ||
| } | ||
| } | ||
| } | ||
| } |
| * Logs a warning for missing components to assist in debugging. | ||
| */ | ||
| async function validatePluginStructure(root: string, manifest: ClaudeManifest): Promise<void> { | ||
| const componentsToCheck: Array<{ name: string; declared: any }> = [ |
| const dirPath = path.join(root, name) | ||
| const exists = await pathExists(dirPath) | ||
| if (!exists) { | ||
| console.warn(`[Claude Plugin Warning]: "${name}" is defined in manifest but directory missing at: ${dirPath}`) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a7872939e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Remove extra closing brace that breaks module parsing
When this parser module is imported, Bun fails to parse it with Unexpected } at this extra brace, so any CLI/test path that loads Claude plugins aborts before running. I checked bun test --filter claude, which fails immediately on this line rather than executing the parser tests.
Useful? React with 👍 / 👎.
Added a validation feature to check the existence of manifest components on disk and log warnings for missing components.