Skill: xueyetianya/lifegoals (version 2.0.0)

--- version: "2.0.0" name: lifegoals description: "Define goals, break them into milestones, and track progress step by step. Use when setting life goals, planning milestones, tracking long-term progress." --- # Lifegoals A command-line devtools toolkit for tracking and managing life goals. Check, validate, generate, format, lint, explain, convert, template, diff, preview, fix, and report on your goals — all from your terminal with persistent logging and full activity history. ## Why Lifegoals? - Works entirely offline — your personal goals never leave your machine - No external dependencies or accounts needed - Every action is timestamped and logged for full auditability - Export your history to JSON, CSV, or plain text anytime - Simple CLI interface with consistent command patterns ## Commands | Command | Description | |---------|-------------| | `lifegoals check <input>` | Check goal entries for completeness; view recent checks without args | | `lifegoals validate <input>` | Validate goal structure, format, and feasibility | | `lifegoals generate <input>` | Generate new goal ideas or milestone breakdowns | | `lifegoals format <input>` | Format goal data for readability or presentation | | `lifegoals lint <input>` | Lint goals for vague language or missing deadlines | | `lifegoals explain <input>` | Explain a goal's structure and progress path | | `lifegoals convert <input>` | Convert goal data between different formats | | `lifegoals template <input>` | Create or apply goal templates for common objectives | | `lifegoals diff <input>` | Diff two goal snapshots to track changes over time | | `lifegoals preview <input>` | Preview goal output or milestone timeline | | `lifegoals fix <input>` | Auto-fix common issues in goal definitions | | `lifegoals report <input>` | Generate a progress report on your goals | | `lifegoals stats` | Show summary statistics across all actions | | `lifegoals export <fmt>` | Export all logs (formats: `json`, `csv`, `txt`) | | `lifegoals search <term>` | Search across all log entries | | `lifegoals recent` | Show the 20 most recent activity entries | | `lifegoals status` | Health check — version, disk usage, entry count | | `lifegoals help` | Show help with all available commands | | `lifegoals version` | Print current version (v2.0.0) | Each data command (check, validate, generate, etc.) works in two modes: - **With arguments** — logs the input with a timestamp and saves to its dedicated log file - **Without arguments** — displays the 20 most recent entries from that command's log ## Getting Started ```bash # See all available commands lifegoals help # Check current system status lifegoals status # View statistics across all commands lifegoals stats ``` ## Data Storage All data is stored locally in `~/.local/share/lifegoals/`. The directory structure: - `check.log`, `validate.log`, `generate.log`, `format.log`, etc. — per-command log files - `history.log` — unified activity log across all commands - `export.json`, `export.csv`, `export.txt` — generated export files Modify the `DATA_DIR` variable in `script.sh` to change the storage path. ## Requirements - **Bash** 4.0+ (uses `set -euo pipefail`) - **Standard Unix tools**: `date`, `wc`, `du`, `tail`, `grep`, `sed`, `cat` - Works on Linux and macOS - No external packages or network access required ## When to Use 1. **Setting new life goals** — use `lifegoals generate` to brainstorm objectives and `lifegoals template` to apply proven goal-setting frameworks like SMART goals 2. **Breaking goals into milestones** — run `lifegoals check` and `lifegoals validate` to ensure each goal has clear, actionable steps and deadlines 3. **Tracking progress over time** — use `lifegoals diff` to compare goal snapshots at different dates and `lifegoals report` to generate progress summaries 4. **Reviewing and refining goals** — run `lifegoals lint` to catch vague language, then `lifegoals fix` to tighten up weak goal definitions 5. **Exporting goal data for sharing** — use `lifegoals export` and `lifegoals convert` to transform your goal history into JSON, CSV, or text for journals, coaches, or planning tools ## Examples ```bash # Check a goal for completeness lifegoals check "Learn Spanish to B2 level by December 2026" # Validate a goal's structure lifegoals validate "Run a marathon — target: sub-4-hours" # Generate milestone ideas for a goal lifegoals generate "Save $50k emergency fund" # Lint a goal for vague language lifegoals lint "Get healthier somehow" # Format goal data for presentation lifegoals format "Career: Get promoted to senior engineer" # Create a goal from a template lifegoals template "fitness-90-day-challenge" # Diff two goal snapshots lifegoals diff "Q1-goals vs Q2-goals" # Generate a progress report lifegoals report "2026-goals" # View summary statistics lifegoals stats # Export all history as JSON lifegoals export json # Search for goals mentioning fitness lifegoals search "fitness" # View recent activity lifegoals recent ``` ## Output All commands output structured text to stdout. You can redirect output to a file: ```bash lifegoals report annual-review > review.txt lifegoals export csv ``` ## Configuration The data directory defaults to `~/.local/share/lifegoals/`. Modify the `DATA_DIR` variable at the top of `script.sh` to customize the storage path. --- Powered by BytesAgain | bytesagain.com | [REDACTED_SECRET]

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

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

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

_help() {
    echo "Lifegoals v2.0.0 — devtools toolkit"
    echo ""
    echo "Usage: lifegoals <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 "=== Lifegoals 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 "=== Lifegoals 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 "=== Lifegoals 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: lifegoals 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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: lifegoals 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 "  [Lifegoals] 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 'lifegoals help'"
        exit 1
        ;;
esac

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