用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill usage-tracker-5-trend-analysis命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | usage-tracker-5-trend-analysis |
| description | Sub-skill of usage-tracker: 5. Trend Analysis (+1). |
| version | 1.0.0 |
| category | _core |
| type | reference |
| scripts_exempt | true |
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:-}"
i $( -1 0);
=$( -d +%Y-%m-%d)
count
[[ -n ]];
count=$(grep 2>/dev/null | \
grep | \
awk -F )
count=$(grep 2>/dev/null | \
awk -F )
}
() {
window=
values=()
=0
count=0
val ;
=$((sum + val))
count=$((count + ))
[[ -ge ]];
$((sum / window))
=$((sum - ))
}
() {
days=
max_width=40
max_val=0
-a daily_data
-r count;
daily_data+=()
[[ -gt ]] && max_val=
< <(get_daily_trend )
[[ -eq 0 ]] && max_val=1
entry ;
=
count=
bar_len=$((count * max_width / max_val))
bar=$( | )
}
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)