feat(skills): support paths in Claude Code skills#1604
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
464dbc5 to
90d2acb
Compare
dyoshikawa-claw
left a comment
There was a problem hiding this comment.
This is a clean, well-tested addition. The schema, conversion, and round-trip all follow the existing patterns for allowed-tools, model, and disable-model-invocation exactly. Test coverage is thorough — string form, array form, validation rejects, and round-trip preservation are all covered.
One small thing: the fromDir method at line 201–225 already handles paths correctly since it delegates to the schema — but no test explicitly exercises importing a SKILL.md from disk with a paths field. The existing round-trip and conversion tests give good confidence, though.
Otherwise, looks good to merge.
dyoshikawa-claw
left a comment
There was a problem hiding this comment.
Clean addition that follows the existing patterns well. The schema, both conversion directions, and the rulesync type are all updated consistently. The test coverage for string/array variants in object conversion and round-trip is thorough.
Two things to consider adding:
- A
fromDirtest forpaths, similar to the existingshould load skill with modeltest, so that YAML parsing of comma-separated strings vs arrays is covered through the I/O path too. - A test that combines
pathswith another claudecode field likemodelorallowed-tools, to verify they don't interfere with each other during the spread-based conversion.
| "allowed-tools": z.optional(z.array(z.string())), | ||
| model: z.optional(z.string()), | ||
| "disable-model-invocation": z.optional(z.boolean()), | ||
| paths: z.optional(z.union([z.string(), z.array(z.string())])), |
There was a problem hiding this comment.
In claudecode-rule.ts, paths accepts only string[], while here it accepts string | string[]. A brief comment explaining this difference would help future maintainers understand it is intentional, not an oversight.
No description provided.