Skill: ckchzh/gitlog (version 2.0.0)

--- name: GitLog description: "View formatted commit history, author stats, and commit frequency patterns. Use when reviewing logs, comparing contributions, or generating repo reports." version: "2.0.0" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["git","log","commits","repository","changelog","developer","vcs"] categories: ["Developer Tools", "Utility"] --- # GitLog GitLog v2.0.0 — a developer toolkit for managing commit history and log analysis from the command line. Log checks, validations, changelog generations, lint results, diffs, and more. Each entry is timestamped and persisted locally. Works entirely offline — your data never leaves your machine. ## Why GitLog? - Works entirely offline — your data never leaves your machine - Simple command-line interface with no GUI dependency - Export to JSON, CSV, or plain text at any time for sharing or archival - Automatic activity history logging across all commands - Each domain command doubles as both a logger and a viewer ## Commands ### Domain Commands Each domain command works in two modes: **log mode** (with arguments) saves a timestamped entry, **view mode** (no arguments) shows the 20 most recent entries. | Command | Description | |---------|-------------| | `gitlog check <input>` | Log a check operation such as verifying commit signatures, author consistency, or branch protection compliance. Track verification outcomes across releases and branches. | | `gitlog validate <input>` | Log a validation entry for commit message format checks, conventional commit compliance, or PR title standards. Record pass/fail outcomes and specific violations found. | | `gitlog generate <input>` | Log a generation task for changelog creation, release notes drafting, or commit summary generation. Track what was generated, the commit range covered, and contributor counts. | | `gitlog format <input>` | Log a formatting operation for reformatting log output, adjusting date formats, or restructuring commit displays. Record the format changes applied and the resulting output style. | | `gitlog lint <input>` | Log a lint result identifying commits with missing scopes, non-standard prefixes, or overly long subject lines. Useful for enforcing consistent commit message quality across teams. | | `gitlog explain <input>` | Log an explanation entry documenting why specific commits were made, architectural decisions behind changes, or context for complex merges. Build an annotated history. | | `gitlog convert <input>` | Log a conversion task for transforming log formats between representations such as markdown changelogs, HTML release pages, or RSS feeds. Record source and target formats. | | `gitlog template <input>` | Log a template operation for creating commit message templates, PR description templates, or changelog section templates. Track template versions and adoption. | | `gitlog diff <input>` | Log a diff result comparing branches, tags, or time ranges. Record commits ahead/behind, divergence points, and merge conflict potential between branches. | | `gitlog preview <input>` | Log a preview entry for reviewing staged commits, upcoming release contents, or draft changelogs before publishing. Useful for pre-release audits. | | `gitlog fix <input>` | Log a fix operation for commit message rewrites, author corrections, or history cleanup. Track what was fixed, the method used (amend, rebase, filter-branch), and the scope of changes. | | `gitlog report <input>` | Log a report entry for commit frequency analysis, contributor statistics, or release cadence summaries. Capture key metrics and trends from repository history. | ### Utility Commands | Command | Description | |---------|-------------| | `gitlog stats` | Show summary statistics across all log files, including entry counts per category and total data size on disk. | | `gitlog export <fmt>` | Export all data to a file in the specified format. Supported formats: `json`, `csv`, `txt`. Output is saved to the data directory. | | `gitlog search <term>` | Search all log entries for a term using case-insensitive matching. Results are grouped by log category for easy scanning. | | `gitlog recent` | Show the 20 most recent entries from the unified activity log, giving a quick overview of recent work across all commands. | | `gitlog status` | Health check showing version, data directory path, total entry count, disk usage, and last activity timestamp. | | `gitlog help` | Show the built-in help message listing all available commands and usage information. | | `gitlog version` | Print the current version (v2.0.0). | ## Data Storage All data is stored locally at `~/.local/share/gitlog/`. Each domain command writes to its own log file (e.g., `check.log`, `lint.log`). A unified `history.log` tracks all actions across commands. Use `export` to back up your data at any time. ## Requirements - Bash (4.0+) - No external dependencies — pure shell script - No network access required ## When to Use - Verifying commit message compliance and signature validity across releases and pull requests - Generating changelogs and release notes from commit history with contributor attribution - Linting commit messages to enforce conventional commit standards across the team - Comparing branch histories and tracking divergence for merge planning and conflict prevention - Building a searchable archive of commit explanations, fixes, and format conversion records ## Examples ```bash # Log a check operation gitlog check "Verified all 47 commits in v2.0 release are GPG-signed by authorized authors" # Generate a changelog entry gitlog generate "v2.0.0 changelog — 47 commits, 12 contributors, 3 breaking changes" # Validate commit messages gitlog validate "All 23 commits follow conventional format: feat(scope): message" # Log a lint result gitlog lint "Found 3 commits with missing scope in message, 1 with subject over 72 chars" # Record a diff comparison gitlog diff "main..feature-auth: 23 commits ahead, 5 behind, no merge conflicts detected" # View all statistics gitlog stats # Export everything to CSV gitlog export csv # Search entries mentioning release gitlog search release # Check recent activity gitlog recent # Health check gitlog status ``` --- Powered by BytesAgain | bytesagain.com | [REDACTED_SECRET]

path: scripts/script.sh
content: #!/usr/bin/env bash
# Gitlog — devtools tool
# Powered by BytesAgain | bytesagain.com | [REDACTED_SECRET]
set -euo pipefail

DATA_DIR="${HOME}/.local/share/gitlog"
mkdir -p "$DATA_DIR"

_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }
_version() { echo "gitlog v2.0.0"; }

_help() {
    echo "Gitlog v2.0.0 — devtools toolkit"
    echo ""
    echo "Usage: gitlog <command> [args]"
    echo ""
    echo "Commands:"
    echo "  check              Check"
    echo "  validate           Validate"
    echo "  generate           Generate"
    echo "  format             Format"
    echo "  lint               Lint"
    echo "  explain            Explain"
    echo "  convert            Convert"
    echo "  template           Template"
    echo "  diff               Diff"
    echo "  preview            Preview"
    echo "  fix                Fix"
    echo "  report             Report"
    echo "  stats              Summary statistics"
    echo "  export <fmt>       Export (json|csv|txt)"
    echo "  search <term>      Search entries"
    echo "  recent             Recent activity"
    echo "  status             Health check"
    echo "  help               Show this help"
    echo "  version            Show version"
    echo ""
    echo "Data: $DATA_DIR"
}

_stats() {
    echo "=== Gitlog Stats ==="
    local total=0
    for f in "$DATA_DIR"/*.log; do
        [ -f "$f" ] || continue
        local name=$(basename "$f" .log)
        local c=$(wc -l < "$f")
        total=$((total + c))
        echo "  $name: $c entries"
    done
    echo "  ---"
    echo "  Total: $total entries"
    echo "  Data size: $(du -sh "$DATA_DIR" 2>/dev/null | cut -f1)"
}

_export() {
    local fmt="${1:-json}"
    local out="$DATA_DIR/export.$fmt"
    case "$fmt" in
        json)
            echo "[" > "$out"
            local first=1
            for f in "$DATA_DIR"/*.log; do
                [ -f "$f" ] || continue
                local name=$(basename "$f" .log)
                while IFS='|' read -r ts val; do
                    [ $first -eq 1 ] && first=0 || echo "," >> "$out"
                    printf '  {"type":"%s","time":"%s","value":"%s"}' "$name" "$ts" "$val" >> "$out"
                done < "$f"
            done
            echo "\n]" >> "$out"
            ;;
        csv)
            echo "type,time,value" > "$out"
            for f in "$DATA_DIR"/*.log; do
                [ -f "$f" ] || continue
                local name=$(basename "$f" .log)
                while IFS='|' read -r ts val; do echo "$name,$ts,$val" >> "$out"; done < "$f"
            done
            ;;
        txt)
            echo "=== Gitlog Export ===" > "$out"
            for f in "$DATA_DIR"/*.log; do
                [ -f "$f" ] || continue
                echo "--- $(basename "$f" .log) ---" >> "$out"
                cat "$f" >> "$out"
            done
            ;;
        *) echo "Formats: json, csv, txt"; return 1 ;;
    esac
    echo "Exported to $out ($(wc -c < "$out") bytes)"
}

_status() {
    echo "=== Gitlog Status ==="
    echo "  Version: v2.0.0"
    echo "  Data dir: $DATA_DIR"
    echo "  Entries: $(cat "$DATA_DIR"/*.log 2>/dev/null | wc -l) total"
    echo "  Disk: $(du -sh "$DATA_DIR" 2>/dev/null | cut -f1)"
    echo "  Last: $(tail -1 "$DATA_DIR/history.log" 2>/dev/null || echo never)"
    echo "  Status: OK"
}

_search() {
    local term="${1:?Usage: gitlog search <term>}"
    echo "Searching for: $term"
    for f in "$DATA_DIR"/*.log; do
        [ -f "$f" ] || continue
        local m=$(grep -i "$term" "$f" 2>/dev/null || true)
        if [ -n "$m" ]; then
            echo "  --- $(basename "$f" .log) ---"
            echo "$m" | sed 's/^/    /'
        fi
    done
}

_recent() {
    echo "=== Recent Activity ==="
    tail -20 "$DATA_DIR/history.log" 2>/dev/null | sed 's/^/  /' || echo "  No activity yet."
}

case "${1:-help}" in
    check)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent check entries:"
            tail -20 "$DATA_DIR/check.log" 2>/dev/null || echo "  No entries yet. Use: gitlog check <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/check.log"
            local total=$(wc -l < "$DATA_DIR/check.log")
            echo "  [Gitlog] check: $input"
            echo "  Saved. Total check entries: $total"
            _log "check" "$input"
        fi
        ;;
    validate)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent validate entries:"
            tail -20 "$DATA_DIR/validate.log" 2>/dev/null || echo "  No entries yet. Use: gitlog validate <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/validate.log"
            local total=$(wc -l < "$DATA_DIR/validate.log")
            echo "  [Gitlog] validate: $input"
            echo "  Saved. Total validate entries: $total"
            _log "validate" "$input"
        fi
        ;;
    generate)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent generate entries:"
            tail -20 "$DATA_DIR/generate.log" 2>/dev/null || echo "  No entries yet. Use: gitlog generate <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/generate.log"
            local total=$(wc -l < "$DATA_DIR/generate.log")
            echo "  [Gitlog] generate: $input"
            echo "  Saved. Total generate entries: $total"
            _log "generate" "$input"
        fi
        ;;
    format)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent format entries:"
            tail -20 "$DATA_DIR/format.log" 2>/dev/null || echo "  No entries yet. Use: gitlog format <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/format.log"
            local total=$(wc -l < "$DATA_DIR/format.log")
            echo "  [Gitlog] format: $input"
            echo "  Saved. Total format entries: $total"
            _log "format" "$input"
        fi
        ;;
    lint)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent lint entries:"
            tail -20 "$DATA_DIR/lint.log" 2>/dev/null || echo "  No entries yet. Use: gitlog lint <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/lint.log"
            local total=$(wc -l < "$DATA_DIR/lint.log")
            echo "  [Gitlog] lint: $input"
            echo "  Saved. Total lint entries: $total"
            _log "lint" "$input"
        fi
        ;;
    explain)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent explain entries:"
            tail -20 "$DATA_DIR/explain.log" 2>/dev/null || echo "  No entries yet. Use: gitlog explain <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/explain.log"
            local total=$(wc -l < "$DATA_DIR/explain.log")
            echo "  [Gitlog] explain: $input"
            echo "  Saved. Total explain entries: $total"
            _log "explain" "$input"
        fi
        ;;
    convert)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent convert entries:"
            tail -20 "$DATA_DIR/convert.log" 2>/dev/null || echo "  No entries yet. Use: gitlog convert <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/convert.log"
            local total=$(wc -l < "$DATA_DIR/convert.log")
            echo "  [Gitlog] convert: $input"
            echo "  Saved. Total convert entries: $total"
            _log "convert" "$input"
        fi
        ;;
    template)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent template entries:"
            tail -20 "$DATA_DIR/template.log" 2>/dev/null || echo "  No entries yet. Use: gitlog template <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/template.log"
            local total=$(wc -l < "$DATA_DIR/template.log")
            echo "  [Gitlog] template: $input"
            echo "  Saved. Total template entries: $total"
            _log "template" "$input"
        fi
        ;;
    diff)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent diff entries:"
            tail -20 "$DATA_DIR/diff.log" 2>/dev/null || echo "  No entries yet. Use: gitlog diff <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/diff.log"
            local total=$(wc -l < "$DATA_DIR/diff.log")
            echo "  [Gitlog] diff: $input"
            echo "  Saved. Total diff entries: $total"
            _log "diff" "$input"
        fi
        ;;
    preview)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent preview entries:"
            tail -20 "$DATA_DIR/preview.log" 2>/dev/null || echo "  No entries yet. Use: gitlog preview <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/preview.log"
            local total=$(wc -l < "$DATA_DIR/preview.log")
            echo "  [Gitlog] preview: $input"
            echo "  Saved. Total preview entries: $total"
            _log "preview" "$input"
        fi
        ;;
    fix)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent fix entries:"
            tail -20 "$DATA_DIR/fix.log" 2>/dev/null || echo "  No entries yet. Use: gitlog fix <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/fix.log"
            local total=$(wc -l < "$DATA_DIR/fix.log")
            echo "  [Gitlog] fix: $input"
            echo "  Saved. Total fix entries: $total"
            _log "fix" "$input"
        fi
        ;;
    report)
        shift
        if [ $# -eq 0 ]; then
            echo "Recent report entries:"
            tail -20 "$DATA_DIR/report.log" 2>/dev/null || echo "  No entries yet. Use: gitlog report <input>"
        else
            local input="$*"
            local ts=$(date '+%Y-%m-%d %H:%M')
            echo "$ts|$input" >> "$DATA_DIR/report.log"
            local total=$(wc -l < "$DATA_DIR/report.log")
            echo "  [Gitlog] report: $input"
            echo "  Saved. Total report entries: $total"
            _log "report" "$input"
        fi
        ;;
    stats) _stats ;;
    export) shift; _export "$@" ;;
    search) shift; _search "$@" ;;
    recent) _recent ;;
    status) _status ;;
    help|--help|-h) _help ;;
    version|--version|-v) _version ;;
    *)
        echo "Unknown: $1 — run 'gitlog help'"
        exit 1
        ;;
esac

Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)