Skip to content

Feature: Add Hooks, Sound Notifications, and Commands/Skills Separation - #42

Merged
tylergraydev merged 6 commits into
mainfrom
feature/hooks-and-sound-notifications
Jan 6, 2026
Merged

tylergraydev merged 6 commits into
mainfrom
feature/hooks-and-sound-notifications

Conversation

@tylergraydev

@tylergraydev tylergraydev commented Jan 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR adds comprehensive hooks management, sound notification capabilities, skill validation, and separates Commands from Skills into distinct entities.

Commands/Skills Separation

Commands and Skills are now properly separated to reflect their distinct purposes:

Commands (Slash Commands):

  • User-invoked via /command-name
  • Stored as single .md files in .claude/commands/
  • Include argumentHint for usage guidance
  • Amber styling with Terminal icon

Skills (Agent Skills):

  • Auto-invoked by Claude based on context
  • Stored as directories with SKILL.md + supporting files in .claude/skills/
  • Include disableModelInvocation option
  • Purple/yellow styling with Sparkles icon

Hooks Management

  • Create, edit, and delete Claude Code hooks with full UI support
  • Support for all hook event types: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Notification, Stop, SubagentStop, SessionEnd
  • Matcher patterns for filtering hooks by tool name or other criteria
  • Assign hooks globally or per-project
  • Export hooks to JSON or clipboard for sharing
  • Pre-built templates for common use cases (auto-format, ESLint, logging, etc.)

Sound Notifications

  • Sound Hook Wizard for easy setup of notification sounds
  • Browse and preview system sounds from macOS/Linux/Windows
  • Upload custom sound files for personalized notifications
  • Preset configurations for common use cases:
    • Task complete notifications
    • Permission required alerts
    • Full notification suite

Sound Playback (Cross-Platform)

  • macOS: Uses afplay
  • Linux: Uses paplay (PulseAudio) or aplay (ALSA)
  • Windows: Uses PowerShell Media.SoundPlayer

Skill Validation (per official Claude Code docs)

  • Name validation: Max 64 chars, lowercase letters/numbers/hyphens only
  • Reserved word rejection: Cannot contain "anthropic" or "claude"
  • Description validation: Max 1024 characters
  • Content warnings: Warns when exceeding 500 lines (recommends splitting)
  • XML tag rejection: Prevents injection via < or > characters

Files Changed

Commands Feature (New)

File Description
src-tauri/src/commands/commands.rs Tauri commands for slash commands CRUD
src-tauri/src/services/command_writer.rs File writer for .claude/commands/
src/lib/types/command.ts Command type definitions
src/lib/stores/commandLibrary.svelte.ts Command state management
src/lib/components/commands/*.svelte Command UI components
src/routes/commands/+page.svelte Commands library page

Backend (Rust)

File Description
src-tauri/src/services/sound_player.rs Sound playback service
src-tauri/src/commands/sounds.rs Tauri commands for sounds
src-tauri/src/commands/hooks.rs Hooks commands + fixed templates
src-tauri/src/commands/skills.rs Updated for skills-only (removed command logic)
src-tauri/src/services/hook_writer.rs Hook file writer
src-tauri/src/db/schema.rs Added commands tables
src-tauri/src/db/models.rs Added Command model

Frontend (Svelte)

File Description
src/lib/components/sounds/*.svelte Sound browser/picker components
src/lib/components/hooks/SoundHookWizard.svelte Guided wizard
src/lib/components/hooks/HookExportModal.svelte Export functionality
src/lib/components/skills/*.svelte Updated for skills-only
src/lib/components/global/GlobalSettings.svelte Added Commands tab
src/routes/+page.svelte Dashboard with Commands stat

Documentation

File Description
README.md Updated with Commands/Skills separation
CLAUDE_CODE_HOOKS_REFERENCE.md Comprehensive hooks reference guide

Test Plan

  • All Rust tests pass (cargo test - 636 tests)
  • All Svelte tests pass (npm test - 196 tests)
  • Manual testing of sound playback on macOS
  • Verify hook creation and assignment works
  • Test sound wizard flow end-to-end
  • Verify skill validation errors display correctly
  • Test Commands CRUD and assignment

🤖 Generated with Claude Code

tylergraydev and others added 3 commits January 2, 2026 00:04
Add new test coverage for the hooks and sound notification features:
- hookLibrary.test.ts: 32 tests covering CRUD, global/project hooks, templates, export, sound hooks
- soundLibrary.test.ts: 16 tests covering load, preview, upload, delete, command generation
- hook.test.ts: 13 tests for hook type definitions and event types
- sound.test.ts: 10 tests for sound utilities and presets

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive hooks system for managing Claude Code hooks:

## Backend (Rust/Tauri)
- Add sound_player service for cross-platform sound playback (macOS, Linux, Windows)
- Add sounds command module with Tauri commands for sound operations
- Extend hooks commands with sound notification hook creation
- Add `dirs` crate dependency for home directory resolution

## Frontend (Svelte)
- Add SoundHookWizard component for guided sound notification setup
- Add SoundBrowser component for browsing system/custom sounds
- Add SoundPicker component for sound selection in forms
- Add HookExportModal for exporting hooks to JSON/clipboard
- Add soundLibrary store for managing sounds state
- Extend hookLibrary store with sound notification methods
- Fix nested button HTML issues in sound components

## Tests
- Add hookLibrary.test.ts (32 tests)
- Add soundLibrary.test.ts (16 tests)
- Add hook.test.ts (13 tests)
- Add sound.test.ts (10 tests)

## Documentation
- Update README with Hooks feature description
- Add CLAUDE_CODE_HOOKS_REFERENCE.md with hook event documentation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comprehensive skill name/description validation per official docs
  - Max 64 chars for name, 1024 for description
  - Lowercase letters, numbers, hyphens only
  - Reject reserved words (anthropic, claude)
  - Warn on content exceeding 500 lines
- Fix hook templates to read input via stdin JSON (not env vars)
  - PreToolUse/PostToolUse receive tool_name, tool_input via stdin
  - Updated all template commands to use `jq` for JSON parsing
- Fix SessionStart hook event type (was incorrectly "Notification")
- Update Tauri capability schemas

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tylergraydev tylergraydev changed the title Feature: Add Hooks management and sound notifications Feature: Add Hooks management, sound notifications, and skill validation Jan 5, 2026
tylergraydev and others added 2 commits January 5, 2026 19:03
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Commands are user-invoked slash commands stored as single .md files:
- Storage: .claude/commands/name.md
- Invocation: /command-name
- Fields: argumentHint for usage hints

Skills are agent-invocable prompts stored as directories:
- Storage: .claude/skills/name/SKILL.md (with supporting files)
- Invocation: Claude auto-invokes based on context
- Fields: disableModelInvocation to require manual invocation

Changes:
- Add Command types, store, components, and /commands route
- Add commands.rs backend with CRUD and assignment operations
- Add command_writer.rs for file sync
- Update Skills to remove command-specific fields
- Add Commands tab to GlobalSettings
- Add Commands stat card to Dashboard
- Update README with accurate structure

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tylergraydev tylergraydev changed the title Feature: Add Hooks management, sound notifications, and skill validation Feature: Add Hooks, Sound Notifications, and Commands/Skills Separation Jan 6, 2026
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tylergraydev
tylergraydev merged commit fb1078e into main Jan 6, 2026
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