fix(mcp): accept comma-string allowed-tools in skill frontmatter (#1252)#1257
Merged
Conversation
SKILL.md files use comma-separated strings for allowed-tools (e.g. "Read, Grep, Glob, Bash(gh:*, git:*)") but the Zod schema only accepted arrays, causing 12 core skills to be silently dropped. Change z.array(z.string()) to z.union([array, string.transform]) with a paren-aware splitter that preserves patterns like Bash(gh:*, git:*).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeremyDev87
commented
Apr 4, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
Review: ✅ APPROVE
CI Status: ALL PASS
Code Review
skill.schema.ts — Critical fix:
splitAllowedTools()function handles comma-separated strings while respecting parenthesized patterns likeBash(gh:*, git:*)- Schema changed from
z.array(z.string())toz.union([array, string.transform(splitAllowedTools)]) - Restores 12 core skills (
pr-review,systematic-debugging,security-audit, etc.) to catalog
skill.schema.spec.ts — 3 new tests:
- Comma-separated string → array
- Comma string with parenthesized patterns → correctly split
- Empty string → empty array
splitAllowedTools is well-implemented with paren depth tracking.
Issues Found: None
Recommendation: APPROVE
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.
Summary
allowed-tools(e.g.Read, Grep, Glob, Bash(gh:*, git:*)), but the Zod schema only accepted arrays — causing 12 core skills to be silently dropped during validationz.array(z.string())toz.union([z.array(z.string()), z.string().transform(...)])with a paren-aware splitter that preserves patterns likeBash(gh:*, git:*)Closes #1252
Test plan
Bash(gh:*, git:*)) preserved as single entry