SuperAPI AI Directory

skill-stats

Office & productivity

View repository

Updated 10-15 19:54

About this skill

Skill Usage Statistics (skill-stats)

Skill Overview

Count and display the usage of installed skills within a specified time period, including:

  • Number of invocations per skill
  • Usage frequency ranking
  • Total usage count
  • Time trend analysis

Usage Flow

  1. Select the statistics time period
  2. Scan the list of installed skills
  3. Analyze conversation history records
  4. Display the statistics results in a beautiful table format

Available Time Periods

Option Description
Today Count usage from 00:00 to now
Past 7 days Count usage over the past week
Past 30 days Count usage over the past month
Past 90 days Count usage over the past three months
All Count all historical records

Output Format

The statistics results are displayed in the form of a Markdown table + visualized bar chart:

📊 技能使用统计报告 (过去 7 天)
═══════════════════════════════════════

排名 | 技能名称        | 调用次数 | 使用频率
─────┼────────────────┼──────────┼──────────
 1   │ auto-skills    │    42    │ ████████░░ 80%
 2   │ idea-to-post   │    28    │ ██████░░░░ 60%
 3   │ humanizer-zh   │    15    │ ███░░░░░░░ 30%
─────┼────────────────┼──────────┼──────────
     │ 总计           │    85    │

Implementation Steps

Step 1: Select the time period

Use the AskUserQuestion tool to let the user select the statistics time period.

Step 2: Scan installed skills

List all skills under the ~/.claude/skills/ directory.

Step 3: Analyze history records

Parse the following files:

  • ~/.claude/history.jsonl(global history)
  • ~/.claude/projects/*/session.jsonl(project sessions)

Find records matching the /skill-name pattern.

Step 4: Statistics and display

Calculate the usage count of each skill and display them in descending order.

Data Notes

  • Skill identification: Identify skill invocations by matching the display field in history records against the /skill-name pattern
  • Time filtering:timestamp is a millisecond-level timestamp (number), which needs to be divided by 1000 to convert to seconds
  • Unused skills: displayed as 0 times in the results
  • History file locations:~/.claude/history.jsonl and ~/.claude/projects/*/*.jsonl

Execution Instructions

When the user invokes this skill, please execute the following steps:

  1. First, use AskUserQuestion to ask for the statistics time period
  2. Directly call the ~/.claude/skills/skill-stats/stats.py script, passing in the time period parameter
  3. Directly use the script output as the final reply, without any additional processing or wrapping

Time period parameter mapping:

User selection Script parameter
Today today
Past 7 days past_7_days
Past 30 days past_30_days
Past 90 days past_90_days
All all

Call example:

python3 ~/.claude/skills/skill-stats/stats.py past_30_days
  1. Important: Output the statistics report directly as the final reply to the user, do not only output short descriptions such as "statistics complete"