Skip to content

fix(mcp): accept comma-string allowed-tools in skill frontmatter (#1252)#1257

Merged
JeremyDev87 merged 1 commit into
masterfrom
taskmaestro/1775262143/pane-1
Apr 4, 2026
Merged

fix(mcp): accept comma-string allowed-tools in skill frontmatter (#1252)#1257
JeremyDev87 merged 1 commit into
masterfrom
taskmaestro/1775262143/pane-1

Conversation

@JeremyDev87

Copy link
Copy Markdown
Owner

Summary

  • 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 during validation
  • Changed z.array(z.string()) to z.union([z.array(z.string()), z.string().transform(...)]) with a paren-aware splitter that preserves patterns like Bash(gh:*, git:*)
  • Added 3 new test cases (comma string, parenthesized patterns, empty string) plus renamed existing array test for clarity

Closes #1252

Test plan

  • Comma-separated string → parsed to array
  • Parenthesized patterns (Bash(gh:*, git:*)) preserved as single entry
  • Empty string → empty array
  • Existing array format unchanged
  • All 5843 tests pass
  • TypeScript type check passes
  • Prettier formatting applied

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:*).
@vercel

vercel Bot commented Apr 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Apr 4, 2026 0:35am

@JeremyDev87 JeremyDev87 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: ✅ APPROVE

CI Status: ALL PASS

Code Review

skill.schema.ts — Critical fix:

  • splitAllowedTools() function handles comma-separated strings while respecting parenthesized patterns like Bash(gh:*, git:*)
  • Schema changed from z.array(z.string()) to z.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

@JeremyDev87 JeremyDev87 added the fix label Apr 4, 2026
@JeremyDev87 JeremyDev87 self-assigned this Apr 4, 2026
@JeremyDev87 JeremyDev87 merged commit 8a09803 into master Apr 4, 2026
25 checks passed
@JeremyDev87 JeremyDev87 deleted the taskmaestro/1775262143/pane-1 branch April 4, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(mcp): allowed-tools schema accepts array but SKILL.md uses comma string — 12 skills silently dropped

1 participant