usage-tracker-5-trend-analysis
정보
이 스킬은 기간을 비교하고 Claude Code 로그의 패턴을 식별하여 시간 경과에 따른 사용 추세를 분석합니다. `get_daily_trend()`와 같은 기능을 제공하여 지정된 범주와 일자에 대한 일별 총계를 조회할 수 있습니다. 사용 패턴을 추적하거나 이동 평균을 계산하거나 과거 데이터 분석을 수행해야 할 때 활용하세요.
빠른 설치
Claude Code
추천npx skills add vamseeachanta/workspace-hub/plugin add https://github.com/vamseeachanta/workspace-hubgit clone https://github.com/vamseeachanta/workspace-hub.git ~/.claude/skills/usage-tracker-5-trend-analysisClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
5. Trend Analysis (+1)
5. Trend Analysis
Analyze usage trends over time:
#!/bin/bash
# ABOUTME: Usage trend analysis
# ABOUTME: Compare periods and identify patterns
# Get daily totals for last N days
get_daily_trend() {
local days="${1:-7}"
local category="${2:-}"
for i in $(seq $days -1 0); do
local date=$(date -d "$i days ago" +%Y-%m-%d)
local count
if [[ -n "$category" ]]; then
count=$(grep "$date" "$USAGE_LOG" 2>/dev/null | \
grep "|${category}|" | \
awk -F'|' '{sum+=$4} END {print sum+0}')
else
count=$(grep "$date" "$USAGE_LOG" 2>/dev/null | \
awk -F'|' '{sum+=$4} END {print sum+0}')
fi
echo "$date $count"
done
}
# Calculate moving average
moving_average() {
local window="${1:-3}"
local values=("${@:2}")
local sum=0
local count=0
for val in "${values[@]}"; do
sum=$((sum + val))
count=$((count + 1))
if [[ $count -ge $window ]]; then
echo $((sum / window))
sum=$((sum - ${values[$((count - window))]}))
fi
done
}
# Display trend chart (ASCII)
display_trend_chart() {
local days="${1:-14}"
local max_width=40
echo ""
echo "Usage Trend (Last $days days)"
echo "────────────────────────────────────────"
local max_val=0
declare -a daily_data
while read -r date count; do
daily_data+=("$date:$count")
[[ $count -gt $max_val ]] && max_val=$count
done < <(get_daily_trend "$days")
[[ $max_val -eq 0 ]] && max_val=1
for entry in "${daily_data[@]}"; do
local date="${entry%:*}"
local count="${entry#*:}"
local bar_len=$((count * max_width / max_val))
local bar=$(printf "%${bar_len}s" | tr ' ' '█')
printf "%s │%s %d\n" "${date:5}" "$bar" "$count"
done
echo "────────────────────────────────────────"
}
6. Export and Reporting
Export data for external analysis:
#!/bin/bash
# ABOUTME: Export usage data to various formats
# ABOUTME: CSV, JSON, Markdown reports
# Export to CSV
export_csv() {
local period="${1:-week}"
local output="${2:-usage_export.csv}"
echo "timestamp,category,item,value,metadata" > "$output"
get_usage_period "$period" | tr '|' ',' >> "$output"
echo "Exported to $output"
}
# Export to JSON
export_json() {
local period="${1:-week}"
local output="${2:-usage_export.json}"
echo "[" > "$output"
local first=true
while IFS='|' read -r ts cat item val meta; do
[[ "$ts" =~ ^#.*$ ]] && continue
[[ -z "$ts" ]] && continue
[[ "$first" == "false" ]] && echo "," >> "$output"
first=false
cat >> "$output" << EOF
{
"timestamp": "$ts",
"category": "$cat",
"item": "$item",
"value": $val,
"metadata": "$meta"
}
EOF
done < <(get_usage_period "$period")
echo "]" >> "$output"
echo "Exported to $output"
}
# Generate markdown report
generate_markdown_report() {
local period="${1:-week}"
local output="${2:-usage_report.md}"
cat > "$output" << EOF
# Usage Report - Week of $(date +%Y-%m-%d)
GitHub 저장소
연관 스킬
algorithmic-art
메타This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.
subagent-driven-development
개발This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.
executing-plans
디자인Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.
cost-optimization
기타This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.
