feat: スラッシュコマンドセレクターで .claude/skills も表示する (#343)#346
Merged
Conversation
- Add 'skill' to SlashCommandCategory and SlashCommandSource types - Implement loadSkills() to read SKILL.md frontmatter (name, description) - Add safeParseFrontmatter() to disable gray-matter JS engine (S001) - Implement deduplicateByName() with command priority over skills - Add skillsCache independent from commandsCache, cleared together - Add 'skill' to CATEGORY_ORDER between workflow and standard-session - Update API route to include skill count in sources response - Add comprehensive tests (31 unit + 19 command-merger + 3 integration) - Coverage: slash-commands.ts 93%, command-merger.ts 93%, route.ts 84% Resolves #343 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add documentation comments to improve code maintainability for Issue #343: - filterCommands(): note that it only searches commandsCache, not skills - loadSlashCommands(): document dual commandsCache assignment pattern - loadSkills(): explain async declaration rationale (consistency) - parseSkillFile(): [D009] clarify cliTools vs allowed-tools distinction - route.ts: TODO for SlashCommandsResponse type unification with api-client.ts No logic changes. All tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…orts - Add slash-commands module entries to CLAUDE.md - Add Issue #343 to implementation-history.md - Add design policy, issue review, design review, and pm-auto-dev reports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
.claude/skills/*/SKILL.mdの frontmatter(name, description)を読み込み、スラッシュコマンドセレクターに「Skills」カテゴリとして統合表示safeParseFrontmatter()で gray-matter の JavaScript エンジン(eval RCE)を無効化deduplicateByName()で同名の command が skill を優先する明示的な重複排除skillsCacheをcommandsCacheとは独立管理(片方失敗時の耐障害性確保)..拒否、パス検証、ファイルサイズ上限(64KB)、走査上限(100件)、フィールド長制限sourcesにskillカウントを追加Changes
src/types/slash-commands.tsSlashCommandCategory/SlashCommandSourceに'skill'追加、CATEGORY_LABELSにskill: 'Skills'追加src/lib/slash-commands.tsloadSkills(),safeParseFrontmatter(),deduplicateByName(),skillsCache,getSlashCommandGroups()拡張src/lib/command-merger.tsCATEGORY_ORDERに'skill'を workflow と standard-session の間に追加src/app/api/worktrees/[id]/slash-commands/route.tssources.skillカウント追加、flatMap DRY化tests/unit/slash-commands.test.tstests/unit/lib/command-merger.test.tstests/integration/api-worktree-slash-commands.test.tsTest plan
npx tsc --noEmit— エラー0件npm run lint— 警告・エラー0件npm run test:unit— 3743/3743 テストパス(184ファイル)Closes #343
🤖 Generated with Claude Code