Commit Graph

11 Commits

Author SHA1 Message Date
Pregum 0ce3036801 feat: add UserPromptSubmit hook for direct slash command tracking
- Add user_prompt_command_counter.js to detect slash commands in user prompts
- Update hooks.json with UserPromptSubmit hook configuration
- Records events with source: "user_prompt" to distinguish from tool invocations

This enables tracking when users directly type slash commands (e.g., /command),
which previously wasn't captured by the PostToolUse SlashCommand hook.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 15:16:07 +09:00
Pregum 65dc3192f1 feat: add slash command usage tracking
- Add slash_command_counter.js hook to record SlashCommand tool usage
- Update hooks.json to trigger counter on PostToolUse for SlashCommand
- Enhance skill-stats.js to display both skill and command statistics
- Add reset option to skill-stats.js for clearing usage data

Note: This only tracks when Claude programmatically invokes slash
commands via the SlashCommand tool, not direct user input.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 15:09:30 +09:00
Pregum a8b5d3cc57 fix: remove error details from log messages to prevent info leakage
- Remove error.message from loadEventsData() catch block
- Remove error.message from saveEventsData() catch block
- Remove redundant main().catch() handler (already handled inside main)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 14:40:25 +09:00
Pregum f910df823c fix: add event validation and update descriptions to match implementation
- Add validation for event.skill in skill_usage_sender.js
- Update plugin.json description to reflect local-only storage
- Update marketplace.json description and features to match current implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:08 +09:00
Pregum 02fd4e0b7e fix: add error handling and async I/O, add privacy section
- Add catch handler to main() for unhandled promise rejections
- Use fs.promises for async file I/O operations
- Add privacy and data handling section to README

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:08 +09:00
Pregum 3dbc883ab4 chore: remove unused sendRegistration.js
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:08 +09:00
Pregum 989a99b5d0 docs: update README with collected data details and troubleshooting
- Add table explaining collected data (git config, context info)
- Document /skill-stats custom command
- Add troubleshooting for permission denied errors
- Note that Stop hook doesn't work with Ctrl+C

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:08 +09:00
Pregum 9c7c52ed2e feat: add skill-stats command for usage summary
- Add bin/skill-stats.js for displaying skill usage statistics
- Add commands/skill-stats.md as custom slash command

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:08 +09:00
Pregum 2f9f9fc8c7 feat: add skill usage tracking with timestamp and user info
- Enhance skill_usage_counter.js to record detailed event data
  - Timestamp, user info (git config), context (project, branch, hostname)
- Add skill_usage_sender.js for Stop hook to display usage summary
- Update hooks.json to include Stop hook
- Simplify README for current feature scope

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:08 +09:00
Pregum ce2b6c858f refactor: simplify skill-usage-tracker plugin configuration
- Remove tools configuration from plugin.json (keep hooks only)
- Move sendRegistration.js from tools/ to root directory

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:08 +09:00
Pregum d19eddbf34 Add skill-usage-tracker plugin for monitoring skill invocations
This plugin provides two main features:
1. Automatic skill usage counting via PostToolUse hook
2. Custom command to send registration data with usage statistics

Features:
- Tracks skill invocations automatically through PostToolUse hook
- Stores usage counts in ~/.claude/hooks/state/skill_usage_counts.json
- Provides sendRegistration command to POST data to external services
- Configurable endpoint URL via environment variables or CLI args
- Combines user payload with skill usage statistics

Technical details:
- Requires Node.js 18.0.0+ (for native fetch API support)
- Hook matcher: "Skill" tool
- Data persistence: JSON file storage
- Executable scripts with proper permissions

Author: HINO, Yasushi <y.hino@xtone.co.jp>

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 14:27:07 +09:00