Runstr analytics
by @katla50
Advanced RUNSTR fitness analytics with trend analysis, performance insights, training recommendations, and correlation tracking. Analyzes workout history, ha...
clawhub install runstr-analyticsπ About This Skill
name: runstr-analytics description: Advanced RUNSTR fitness analytics with trend analysis, performance insights, training recommendations, and correlation tracking. Analyzes workout history, habits, mood, and steps to provide personalized coaching insights and identify patterns in training effectiveness. metadata: {"openclaw":{"emoji":"π","requires":{"bins":["nak","python3"],"python_packages":["pandas","numpy","scipy","requests"]},"install":[{"id":"go","kind":"go","package":"github.com/fiatjaf/nak@latest","bins":["nak"],"label":"Install nak via Go"},{"id":"python_deps","kind":"pip","packages":["pandas","numpy","scipy","requests"],"label":"Install Python analytics dependencies"}]}}
RUNSTR Analytics Skill
Advanced fitness analytics and coaching insights for RUNSTR data. Provides trend analysis, performance tracking, habit correlation, and personalized training recommendations.
Setup
Required: RUNSTR_NSEC environment variable
This skill requires your Nostr private key (nsec1...) to decrypt RUNSTR backup data.
Option 1 - For OpenClaw/chat usage: Tell your bot: "Here's my RUNSTR nsec: nsec1..."
Option 2 - For CLI/cron automation:
export RUNSTR_NSEC="nsec1..."
β οΈ Security note: The nsec is passed securely via stdin (not CLI arguments) to prevent exposure in process lists. Cache files use restrictive permissions (0700/0600).
Features
Quick Start
Extended version (recommended - with local cache):
# First run - fetch from Nostr and cache locally
python3 scripts/analyze_extended.py --nsec --days 60 --insights --force-refreshSubsequent runs - use cached data (no nsec needed!)
python3 scripts/analyze_extended.py --days 60 --insights
Lightweight version (basic analysis):
python3 scripts/analyze_light.py --nsec --days 30 --insights
Full version (requires pandas, numpy, scipy):
# Install dependencies first: pip3 install pandas numpy scipy
python3 scripts/analyze.py --nsec --days 60 --coaching-report
Commands
| Flag | Description |
|------|-------------|
| --nsec | Your Nostr private key (nsec1...) |
| --days | Analysis period (default: 30) |
| --insights | Generate improvement tips |
| --coaching-report | Full coaching analysis |
| --training-plan | Path to training plan markdown file |
| --trends | Show trend visualizations |
| --correlations | Analyze habit/mood correlations |
| --pb | Show personal records |
| --challenges | Generate weekly challenges |
Data Sources
1. Nostr Encrypted Backup (Kind 30078): Primary workout, habit, journal data 2. Local Cache: SQLite database for fast re-analysis 3. Training Plans: Markdown files with structured training schedules
Extended Features (analyze_extended.py)
Local Cache
~/.cache/runstr-analytics/Week-to-Week Comparison
# Shows last 4 weeks with trends
python3 scripts/analyze_extended.py --insights
Personal Records
Visual Charts
Automated Daily Updates
# Set up daily cron job (runs at 07:00)
./setup_cron.shView latest automated report
./view_report.shCheck update logs
tail -f ~/.cache/runstr-analytics/daily_update.log
The automation will:
~/.cache/runstr-analytics/latest_report.txtUsage Examples
# First time setup - fetch and cache
python3 scripts/analyze_extended.py --nsec nsec1... --force-refreshDaily check - uses cache
python3 scripts/analyze_extended.py --insightsAnalyze last 90 days
python3 scripts/analyze_extended.py --days 90 --insightsForce re-fetch from Nostr (after new backup)
python3 scripts/analyze_extended.py --nsec nsec1... --force-refreshSet up automatic daily updates
./setup_cron.shView today's automated report
./view_report.sh
Analytics Engine
Trend Calculations
Correlation Analysis
Recommendation Engine
Output Formats
--format json)--format md)Security Considerations
Private Key Handling
ps)Local Data Protection
~/.cache/runstr-analytics/runstr_cache.dbRecommended Installation
nak binary to a specific release rather than using @latestPrivacy
π‘ Examples
Extended version (recommended - with local cache):
# First run - fetch from Nostr and cache locally
python3 scripts/analyze_extended.py --nsec --days 60 --insights --force-refreshSubsequent runs - use cached data (no nsec needed!)
python3 scripts/analyze_extended.py --days 60 --insights
Lightweight version (basic analysis):
python3 scripts/analyze_light.py --nsec --days 30 --insights
Full version (requires pandas, numpy, scipy):
# Install dependencies first: pip3 install pandas numpy scipy
python3 scripts/analyze.py --nsec --days 60 --coaching-report
βοΈ Configuration
Required: RUNSTR_NSEC environment variable
This skill requires your Nostr private key (nsec1...) to decrypt RUNSTR backup data.
Option 1 - For OpenClaw/chat usage: Tell your bot: "Here's my RUNSTR nsec: nsec1..."
Option 2 - For CLI/cron automation:
export RUNSTR_NSEC="nsec1..."
β οΈ Security note: The nsec is passed securely via stdin (not CLI arguments) to prevent exposure in process lists. Cache files use restrictive permissions (0700/0600).