Skip to content

Conversation

@choru-k
Copy link

@choru-k choru-k commented Nov 2, 2025

Issue: #642

This PR introduces a complete slash command feature that allows users to create, discover, and use custom
commands from both global (~/.claude/commands) and project (.claude/commands) directories.

🚀 Key Features

Command System

  • Namespace Support: Organize commands with directory-based namespaces (/namespace:command)
  • Global & Project Commands: Separate command scopes for system-wide vs project-specific functionality
  • Frontmatter Parsing: YAML metadata support for command descriptions and examples
  • Real-time Discovery: Automatic scanning and loading of available commands

User Experience

  • Intelligent Dropdown: Contextual command suggestions with keyboard navigation
  • Type-ahead Search: Prefix matching for quick command discovery
  • Command Insertion: One-click command insertion into text areas

🎯 Usage Examples

Creating Commands

  ---
  name: deploy
  description: Deploy current changes to production
  examples:
    - "/deploy staging"
    - "/deploy production"
  ---

Using Commands

Users can type / in any supported text area to see available commands:

  • /deploy - Basic command usage
  • /tools:deploy - Namespaced command
  • Type-ahead filtering for quick discovery

choru-k and others added 5 commits October 30, 2025 17:01
- Add #[repr(u8)] to CommandCategory enum for stable IDs
- Implement path-based hashing to prevent ID collisions
- Replace unwrap_or_default with proper serialization error handling
- Harden path validation with canonicalization against symlinks

Resolves consensus-identified issues from PR review including:
- ID collision risk with namespace containing hyphens
- Enum casting brittleness when variants are reordered
- Silent serialization failures masking data corruption
- Path traversal vulnerabilities in command file access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Add user-friendly error handling to prevent silent failures and improve UX:

- Error state management with slashCommandError tracking
- Enhanced API error handling with HTTP status validation
- Inline error alerts with retry functionality using existing Alert component
- Improved empty states with context-aware messaging
- Graceful degradation when slash commands fail to load

Users now see clear error messages with retry options instead of silent failures,
following the "Simple is best" principle while improving reliability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
implement claude-slash-command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant