@clawhub-xueyetianya-5e1be6a645
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Load Tester concepts, best practices, and implementation patterns.
--- name: "load-tester" version: "2.0.3" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Load Tester concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [load,tester, reference] category: "devtools" --- # Load Tester Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Load Tester concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # load-tester — Load Tester reference tool. Use when working with load tester in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.2" show_help() { cat << 'HELPEOF' load-tester v$VERSION — Load Tester Reference Tool Usage: load-tester <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Load Tester — Overview ## What is Load Tester? Load Tester (load-tester) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with load tester. ## Key Concepts - Core load tester principles and fundamentals - How load tester fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Load Tester Matters Understanding load tester is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic load tester concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Load Tester — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the load tester package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Load Tester — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for load tester 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Load Tester — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Load Tester — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Load Tester — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Load Tester — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Load Tester — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "load-tester v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: load-tester help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Graphql Client concepts, best practices, and implementation patte...
--- name: "graphql-client" version: "2.0.2" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Graphql Client concepts, best practices, and implementation patte..." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [graphql,client, reference] category: "devtools" --- # Graphql Client Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Graphql Client concepts, best practices, and implementation patte... No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # graphql-client — Graphql Client reference tool. Use when working with graphql client in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.1" show_help() { cat << 'HELPEOF' graphql-client v$VERSION — Graphql Client Reference Tool Usage: graphql-client <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Graphql Client — Overview ## What is Graphql Client? Graphql Client (graphql-client) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with graphql client. ## Key Concepts - Core graphql client principles and fundamentals - How graphql client fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Graphql Client Matters Understanding graphql client is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic graphql client concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Graphql Client — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the graphql client package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Graphql Client — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for graphql client 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Graphql Client — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Graphql Client — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Graphql Client — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Graphql Client — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Graphql Client — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "graphql-client v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: graphql-client help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Dev Environment concepts, best practices, and implementation patt...
--- name: "dev-environment" version: "2.0.3" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Dev Environment concepts, best practices, and implementation patt..." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [dev,environment, reference] category: "devtools" --- # Dev Environment Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Dev Environment concepts, best practices, and implementation patt... No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # dev-environment — Dev Environment reference tool. Use when working with dev environment in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.2" show_help() { cat << 'HELPEOF' dev-environment v$VERSION — Dev Environment Reference Tool Usage: dev-environment <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Dev Environment — Overview ## What is Dev Environment? Dev Environment (dev-environment) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with dev environment. ## Key Concepts - Core dev environment principles and fundamentals - How dev environment fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Dev Environment Matters Understanding dev environment is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic dev environment concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Dev Environment — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the dev environment package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Dev Environment — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for dev environment 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Dev Environment — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Dev Environment — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Dev Environment — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Dev Environment — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Dev Environment — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "dev-environment v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: dev-environment help"; exit 1 ;; esac
Label Studio is a multi-type data labeling and annotation tool with standardized output format label studio, typescript, annotation, annotation-tool.
--- version: "2.0.0" name: Label Studio description: "Label Studio is a multi-type data labeling and annotation tool with standardized output format label studio, typescript, annotation, annotation-tool." --- # Data Labeler A data processing and labeling toolkit for ingesting, transforming, querying, and managing data entries from the command line. All operations are logged with timestamps and stored locally. ## Commands ### Data Operations Each data command works in two modes: run without arguments to view recent entries, or pass input to record a new entry. | Command | Description | |---------|-------------| | `data-labeler ingest <input>` | Ingest data — record a new ingest entry or view recent ones | | `data-labeler transform <input>` | Transform data — record a transformation or view recent ones | | `data-labeler query <input>` | Query data — record a query or view recent ones | | `data-labeler filter <input>` | Filter data — record a filter operation or view recent ones | | `data-labeler aggregate <input>` | Aggregate data — record an aggregation or view recent ones | | `data-labeler visualize <input>` | Visualize data — record a visualization or view recent ones | | `data-labeler export <input>` | Export data — record an export entry or view recent ones | | `data-labeler sample <input>` | Sample data — record a sample or view recent ones | | `data-labeler schema <input>` | Schema management — record a schema entry or view recent ones | | `data-labeler validate <input>` | Validate data — record a validation or view recent ones | | `data-labeler pipeline <input>` | Pipeline management — record a pipeline step or view recent ones | | `data-labeler profile <input>` | Profile data — record a profile or view recent ones | ### Utility Commands | Command | Description | |---------|-------------| | `data-labeler stats` | Show summary statistics — entry counts per category, total entries, disk usage | | `data-labeler export <fmt>` | Export all data to a file (formats: `json`, `csv`, `txt`) | | `data-labeler search <term>` | Search all log files for a term (case-insensitive) | | `data-labeler recent` | Show last 20 entries from activity history | | `data-labeler status` | Health check — version, data directory, entry count, disk usage, last activity | | `data-labeler help` | Show available commands | | `data-labeler version` | Show version (v2.0.0) | ## Data Storage All data is stored locally at `~/.local/share/data-labeler/`: - Each data command writes to its own log file (e.g., `ingest.log`, `transform.log`) - Entries are stored as `timestamp|value` pairs (pipe-delimited) - All actions are tracked in `history.log` with timestamps - Export generates files in the data directory (`export.json`, `export.csv`, or `export.txt`) ## Requirements - Bash (with `set -euo pipefail`) - Standard Unix utilities: `date`, `wc`, `du`, `grep`, `tail`, `cat`, `sed` - No external dependencies or API keys required ## When to Use - To log and track data processing operations (ingest, transform, query, etc.) - To maintain a searchable history of data pipeline activities - To export accumulated records in JSON, CSV, or plain text format - As part of larger automation or data-pipeline workflows - When you need a lightweight, local-only data operation tracker ## Examples ```bash # Record a new ingest entry data-labeler ingest "loaded customer_data.csv 5000 rows" # View recent transform entries data-labeler transform # Search across all logs data-labeler search "customer" # Export everything as JSON data-labeler export json # Check overall statistics data-labeler stats # View recent activity data-labeler recent # Health check data-labeler status ``` --- Powered by BytesAgain | bytesagain.com | [email protected] 💬 Feedback & Feature Requests: https://bytesagain.com/feedback FILE:scripts/script.sh #!/usr/bin/env bash # Data Labeler — data tool # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail DATA_DIR="HOME/.local/share/data-labeler" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } _version() { echo "data-labeler v2.0.0"; } _help() { echo "Data Labeler v2.0.0 — data toolkit" echo "" echo "Usage: data-labeler <command> [args]" echo "" echo "Commands:" echo " ingest Ingest" echo " transform Transform" echo " query Query" echo " filter Filter" echo " aggregate Aggregate" echo " visualize Visualize" echo " export Export" echo " sample Sample" echo " schema Schema" echo " validate Validate" echo " pipeline Pipeline" echo " profile Profile" 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 "=== Data Labeler 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="-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 "=== Data Labeler 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 "=== Data Labeler 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="?Usage: data-labeler 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 "-help" in ingest) shift if [ $# -eq 0 ]; then echo "Recent ingest entries:" tail -20 "$DATA_DIR/ingest.log" 2>/dev/null || echo " No entries yet. Use: data-labeler ingest <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/ingest.log" local total=$(wc -l < "$DATA_DIR/ingest.log") echo " [Data Labeler] ingest: $input" echo " Saved. Total ingest entries: $total" _log "ingest" "$input" fi ;; transform) shift if [ $# -eq 0 ]; then echo "Recent transform entries:" tail -20 "$DATA_DIR/transform.log" 2>/dev/null || echo " No entries yet. Use: data-labeler transform <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/transform.log" local total=$(wc -l < "$DATA_DIR/transform.log") echo " [Data Labeler] transform: $input" echo " Saved. Total transform entries: $total" _log "transform" "$input" fi ;; query) shift if [ $# -eq 0 ]; then echo "Recent query entries:" tail -20 "$DATA_DIR/query.log" 2>/dev/null || echo " No entries yet. Use: data-labeler query <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/query.log" local total=$(wc -l < "$DATA_DIR/query.log") echo " [Data Labeler] query: $input" echo " Saved. Total query entries: $total" _log "query" "$input" fi ;; filter) shift if [ $# -eq 0 ]; then echo "Recent filter entries:" tail -20 "$DATA_DIR/filter.log" 2>/dev/null || echo " No entries yet. Use: data-labeler filter <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/filter.log" local total=$(wc -l < "$DATA_DIR/filter.log") echo " [Data Labeler] filter: $input" echo " Saved. Total filter entries: $total" _log "filter" "$input" fi ;; aggregate) shift if [ $# -eq 0 ]; then echo "Recent aggregate entries:" tail -20 "$DATA_DIR/aggregate.log" 2>/dev/null || echo " No entries yet. Use: data-labeler aggregate <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/aggregate.log" local total=$(wc -l < "$DATA_DIR/aggregate.log") echo " [Data Labeler] aggregate: $input" echo " Saved. Total aggregate entries: $total" _log "aggregate" "$input" fi ;; visualize) shift if [ $# -eq 0 ]; then echo "Recent visualize entries:" tail -20 "$DATA_DIR/visualize.log" 2>/dev/null || echo " No entries yet. Use: data-labeler visualize <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/visualize.log" local total=$(wc -l < "$DATA_DIR/visualize.log") echo " [Data Labeler] visualize: $input" echo " Saved. Total visualize entries: $total" _log "visualize" "$input" fi ;; export) shift if [ $# -eq 0 ]; then echo "Recent export entries:" tail -20 "$DATA_DIR/export.log" 2>/dev/null || echo " No entries yet. Use: data-labeler export <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/export.log" local total=$(wc -l < "$DATA_DIR/export.log") echo " [Data Labeler] export: $input" echo " Saved. Total export entries: $total" _log "export" "$input" fi ;; sample) shift if [ $# -eq 0 ]; then echo "Recent sample entries:" tail -20 "$DATA_DIR/sample.log" 2>/dev/null || echo " No entries yet. Use: data-labeler sample <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/sample.log" local total=$(wc -l < "$DATA_DIR/sample.log") echo " [Data Labeler] sample: $input" echo " Saved. Total sample entries: $total" _log "sample" "$input" fi ;; schema) shift if [ $# -eq 0 ]; then echo "Recent schema entries:" tail -20 "$DATA_DIR/schema.log" 2>/dev/null || echo " No entries yet. Use: data-labeler schema <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/schema.log" local total=$(wc -l < "$DATA_DIR/schema.log") echo " [Data Labeler] schema: $input" echo " Saved. Total schema entries: $total" _log "schema" "$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: data-labeler 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 " [Data Labeler] validate: $input" echo " Saved. Total validate entries: $total" _log "validate" "$input" fi ;; pipeline) shift if [ $# -eq 0 ]; then echo "Recent pipeline entries:" tail -20 "$DATA_DIR/pipeline.log" 2>/dev/null || echo " No entries yet. Use: data-labeler pipeline <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/pipeline.log" local total=$(wc -l < "$DATA_DIR/pipeline.log") echo " [Data Labeler] pipeline: $input" echo " Saved. Total pipeline entries: $total" _log "pipeline" "$input" fi ;; profile) shift if [ $# -eq 0 ]; then echo "Recent profile entries:" tail -20 "$DATA_DIR/profile.log" 2>/dev/null || echo " No entries yet. Use: data-labeler profile <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/profile.log" local total=$(wc -l < "$DATA_DIR/profile.log") echo " [Data Labeler] profile: $input" echo " Saved. Total profile entries: $total" _log "profile" "$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 'data-labeler help'" exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Zsh Themes concepts, best practices, and implementation patterns.
--- name: "zsh-themes" version: "2.0.2" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Zsh Themes concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [zsh,themes, reference] category: "devtools" --- # Zsh Themes Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Zsh Themes concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # zsh-themes — Zsh Themes reference tool. Use when working with zsh themes in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.1" show_help() { cat << 'HELPEOF' zsh-themes v$VERSION — Zsh Themes Reference Tool Usage: zsh-themes <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Zsh Themes — Overview ## What is Zsh Themes? Zsh Themes (zsh-themes) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with zsh themes. ## Key Concepts - Core zsh themes principles and fundamentals - How zsh themes fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Zsh Themes Matters Understanding zsh themes is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic zsh themes concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Zsh Themes — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the zsh themes package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Zsh Themes — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for zsh themes 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Zsh Themes — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Zsh Themes — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Zsh Themes — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Zsh Themes — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Zsh Themes — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "zsh-themes v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: zsh-themes help"; exit 1 ;; esac
Create HTML slideshows from Markdown with live preview. Use when drafting slides, editing decks, optimizing layouts, scheduling talks, repurposing content.
--- version: "2.0.0" name: slideshow-generator description: "Create HTML slideshows from Markdown with live preview. Use when drafting slides, editing decks, optimizing layouts, scheduling talks, repurposing content." --- # Slideshow Generator Content creation and slide deck toolkit. Draft slides, edit content, optimize layouts, manage schedules, and generate headlines — all from the command line. ## Commands Run `slideshow-generator <command> [args]` to use. | Command | Description | |---------|-------------| | `draft <input>` | Draft slide content or presentation ideas | | `edit <input>` | Edit and refine existing slide text | | `optimize <input>` | Optimize slide content for clarity and impact | | `schedule <input>` | Schedule presentations or talk dates | | `hashtags <input>` | Generate hashtags for slide content or social sharing | | `hooks <input>` | Create attention-grabbing hooks for opening slides | | `cta <input>` | Write calls-to-action for closing slides | | `rewrite <input>` | Rewrite slide content in a different style | | `translate <input>` | Translate slide text to another language | | `tone <input>` | Adjust the tone of slide content (formal, casual, etc.) | | `headline <input>` | Generate headlines or slide titles | | `outline <input>` | Create presentation outlines and structure | | `stats` | Show summary statistics across all log files | | `export <fmt>` | Export all data (json, csv, or txt) | | `search <term>` | Search all entries for a keyword | | `recent` | Show the 20 most recent history entries | | `status` | Health check — version, data size, entry count | | `help` | Show help message | | `version` | Show version (v2.0.0) | Each data command (draft, edit, optimize, schedule, hashtags, hooks, cta, rewrite, translate, tone, headline, outline) works in two modes: - **Without arguments** — displays the 20 most recent entries from its log - **With arguments** — saves the input with a timestamp to its dedicated log file ## Data Storage All data is stored in `~/.local/share/slideshow-generator/`: - `draft.log`, `edit.log`, `optimize.log`, `schedule.log`, `hashtags.log`, `hooks.log` — per-command log files - `cta.log`, `rewrite.log`, `translate.log`, `tone.log`, `headline.log`, `outline.log` — additional command logs - `history.log` — unified activity history across all commands - `export.json`, `export.csv`, `export.txt` — generated export files Set `SLIDESHOW_GENERATOR_DIR` environment variable to override the default data directory. ## Requirements - Bash 4+ with standard coreutils (`date`, `wc`, `du`, `tail`, `grep`, `sed`) - No external dependencies — pure shell implementation ## When to Use 1. **Drafting slide decks** — quickly draft and iterate on presentation content from the terminal 2. **Refining presentation text** — edit, rewrite, or adjust tone of existing slide content 3. **Scheduling talks** — keep track of upcoming presentation dates and deadlines 4. **Creating social hooks** — generate hashtags, headlines, and CTAs for promoting talks online 5. **Outlining presentations** — structure a talk from scratch with hierarchical outlines ## Examples ```bash # Draft slide content slideshow-generator draft "Intro slide: Why AI agents matter in 2026" # Create an outline slideshow-generator outline "1. Problem Statement 2. Our Solution 3. Demo 4. Results 5. Q&A" # Generate a headline slideshow-generator headline "The Future of Autonomous Coding: 5 Trends to Watch" # Write a hook slideshow-generator hooks "What if your code could write itself? (pause) It already can." # Create a CTA slideshow-generator cta "Star our repo on GitHub — join 10k+ developers building the future" # Optimize content slideshow-generator optimize "Slide 3: reduced from 85 words to 32, added visual cue" # Generate hashtags slideshow-generator hashtags "#AIAgents #DevTools #Presentation #TechTalk #Automation" # Schedule a talk slideshow-generator schedule "PyCon 2026: Apr 15 14:00, Room B, 30min slot" # Export all data as JSON slideshow-generator export json # Search entries slideshow-generator search "AI" # View recent activity slideshow-generator recent # Show statistics slideshow-generator stats ``` ## Output All commands output results to stdout. Log entries are stored with timestamps in pipe-delimited format (`YYYY-MM-DD HH:MM|value`). Use `export` to convert all data to JSON, CSV, or plain text. --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/remark.sh.html <!DOCTYPE html> <html><head><title>Slides</title> <style> body{font-family:sans-serif;margin:0} .slide{min-height:100vh;padding:60px;display:flex;flex-direction:column;justify-content:center;border-bottom:1px solid #eee} h1{font-size:2.5em;color:#333}h2{font-size:2em;color:#555} li{font-size:1.3em;margin:8px 0} pre{background:#f5f5f5;padding:15px;border-radius:5px} .footer{text-align:center;color:#999;padding:20px} </style></head><body> <div class="slide"><p>#!/usr/bin/env bash</p><h1>Remark — Markdown slideshow generator (inspired by gnab/remark 12K+ stars)</h1><p>set -euo pipefail</p><p>CMD="-help"; shift 2>/dev/null || true</p><p>case "$CMD" in</p><p>help) echo "Remark — HTML slideshow from Markdown</p><p>Commands:</p><p>generate <file> Convert MD to HTML slideshow</p><p>preview <file> Generate and show file path</p><p>theme <name> Apply theme (dark/light/solarized)</p><p>speaker <file> Add speaker notes format</p><p>info Version info</p><p>Powered by BytesAgain | bytesagain.com";;</p><p>generate)</p><p>f="-"; [ -z "$f" ] && { echo "Usage: generate <file.md>"; exit 1; }</p><p>out="f%.md.html"</p><p>python3 << PYEOF</p><p>with open("$f") as fh: md = fh.read()</p><p>html = """<!DOCTYPE html></p><p><html><head><title>Slides</title></p><p><style></p><p>body{font-family:sans-serif;margin:0}</p><p>.slide{min-height:100vh;padding:60px;display:flex;flex-direction:column;justify-content:center;border-bottom:1px solid #eee}</p><p>h1{font-size:2.5em;color:#333}h2{font-size:2em;color:#555}</p><p>li{font-size:1.3em;margin:8px 0}</p><p>pre{background:#f5f5f5;padding:15px;border-radius:5px}</p><p>.footer{text-align:center;color:#999;padding:20px}</p><p></style></head><body></p><p>"""</p><p>slides = md.split("</p></div> <div class="slide"><p>")</p><p>for i, slide in enumerate(slides):</p><p>content = slide.strip()</p><p>if not content: continue</p><p>html += '<div class="slide">'</p><p>for line in content.split("\\n"):</p><p>line = line.strip()</p><p>if line.startswith("# "): html += "<h1>{}</h1>".format(line[2:])</p><p>elif line.startswith("## "): html += "<h2>{}</h2>".format(line[3:])</p><p>elif line.startswith("### "): html += "<h3>{}</h3>".format(line[4:])</p><p>elif line.startswith("- "): html += "<li>{}</li>".format(line[2:])</p><p>elif line: html += "<p>{}</p>".format(line)</p><p>html += "</div>\\n"</p><p>html += '<div class="footer">Powered by BytesAgain</div></body></html>'</p><p>with open("$out", "w") as fh: fh.write(html)</p><p>print("Generated: $out ({} slides)".format(len(slides)))</p><p>PYEOF</p><p>;;</p><p>preview)</p><p>f="-"; [ -z "$f" ] && { echo "Usage: preview <file>"; exit 1; }</p><p>bash "$0" generate "$f"</p><p>out="f%.md.html"</p><p>echo "Open in browser: file://$(readlink -f "$out" 2>/dev/null || echo "$out")";;</p><p>theme)</p><p>name="-dark"</p><p>case "$name" in</p><p>dark) echo "background:#1a1a2e;color:#eee;h1{color:#e94560}";;</p><p>light) echo "background:#fff;color:#333;h1{color:#0f3460}";;</p><p>solarized) echo "background:#002b36;color:#839496;h1{color:#b58900}";;</p><p>*) echo "Themes: dark, light, solarized";;</p><p>esac;;</p><p>speaker)</p><p>f="-"; [ -z "$f" ] && { echo "Usage: speaker <file>"; exit 1; }</p><p>echo "Add speaker notes with ???:"</p><p>echo " ## Slide Title"</p><p>echo " Content here"</p><p>echo " ???"</p><p>echo " Speaker notes go here";;</p><p>info) echo "Remark v1.0.0"; echo "Inspired by: gnab/remark (12,000+ stars)"; echo "Powered by BytesAgain | bytesagain.com";;</p><p>*) echo "Unknown: $CMD"; exit 1;;</p><p>esac</p></div> <div class="footer">Powered by BytesAgain</div></body></html> FILE:scripts/script.sh #!/usr/bin/env bash # Slideshow Generator — content tool # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail DATA_DIR="HOME/.local/share/slideshow-generator" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } _version() { echo "slideshow-generator v2.0.0"; } _help() { echo "Slideshow Generator v2.0.0 — content toolkit" echo "" echo "Usage: slideshow-generator <command> [args]" echo "" echo "Commands:" echo " draft Draft" echo " edit Edit" echo " optimize Optimize" echo " schedule Schedule" echo " hashtags Hashtags" echo " hooks Hooks" echo " cta Cta" echo " rewrite Rewrite" echo " translate Translate" echo " tone Tone" echo " headline Headline" echo " outline Outline" 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 "=== Slideshow Generator 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="-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 "=== Slideshow Generator 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 "=== Slideshow Generator 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="?Usage: slideshow-generator 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 "-help" in draft) shift if [ $# -eq 0 ]; then echo "Recent draft entries:" tail -20 "$DATA_DIR/draft.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator draft <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/draft.log" local total=$(wc -l < "$DATA_DIR/draft.log") echo " [Slideshow Generator] draft: $input" echo " Saved. Total draft entries: $total" _log "draft" "$input" fi ;; edit) shift if [ $# -eq 0 ]; then echo "Recent edit entries:" tail -20 "$DATA_DIR/edit.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator edit <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/edit.log" local total=$(wc -l < "$DATA_DIR/edit.log") echo " [Slideshow Generator] edit: $input" echo " Saved. Total edit entries: $total" _log "edit" "$input" fi ;; optimize) shift if [ $# -eq 0 ]; then echo "Recent optimize entries:" tail -20 "$DATA_DIR/optimize.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator optimize <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/optimize.log" local total=$(wc -l < "$DATA_DIR/optimize.log") echo " [Slideshow Generator] optimize: $input" echo " Saved. Total optimize entries: $total" _log "optimize" "$input" fi ;; schedule) shift if [ $# -eq 0 ]; then echo "Recent schedule entries:" tail -20 "$DATA_DIR/schedule.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator schedule <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/schedule.log" local total=$(wc -l < "$DATA_DIR/schedule.log") echo " [Slideshow Generator] schedule: $input" echo " Saved. Total schedule entries: $total" _log "schedule" "$input" fi ;; hashtags) shift if [ $# -eq 0 ]; then echo "Recent hashtags entries:" tail -20 "$DATA_DIR/hashtags.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator hashtags <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/hashtags.log" local total=$(wc -l < "$DATA_DIR/hashtags.log") echo " [Slideshow Generator] hashtags: $input" echo " Saved. Total hashtags entries: $total" _log "hashtags" "$input" fi ;; hooks) shift if [ $# -eq 0 ]; then echo "Recent hooks entries:" tail -20 "$DATA_DIR/hooks.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator hooks <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/hooks.log" local total=$(wc -l < "$DATA_DIR/hooks.log") echo " [Slideshow Generator] hooks: $input" echo " Saved. Total hooks entries: $total" _log "hooks" "$input" fi ;; cta) shift if [ $# -eq 0 ]; then echo "Recent cta entries:" tail -20 "$DATA_DIR/cta.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator cta <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/cta.log" local total=$(wc -l < "$DATA_DIR/cta.log") echo " [Slideshow Generator] cta: $input" echo " Saved. Total cta entries: $total" _log "cta" "$input" fi ;; rewrite) shift if [ $# -eq 0 ]; then echo "Recent rewrite entries:" tail -20 "$DATA_DIR/rewrite.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator rewrite <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/rewrite.log" local total=$(wc -l < "$DATA_DIR/rewrite.log") echo " [Slideshow Generator] rewrite: $input" echo " Saved. Total rewrite entries: $total" _log "rewrite" "$input" fi ;; translate) shift if [ $# -eq 0 ]; then echo "Recent translate entries:" tail -20 "$DATA_DIR/translate.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator translate <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/translate.log" local total=$(wc -l < "$DATA_DIR/translate.log") echo " [Slideshow Generator] translate: $input" echo " Saved. Total translate entries: $total" _log "translate" "$input" fi ;; tone) shift if [ $# -eq 0 ]; then echo "Recent tone entries:" tail -20 "$DATA_DIR/tone.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator tone <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/tone.log" local total=$(wc -l < "$DATA_DIR/tone.log") echo " [Slideshow Generator] tone: $input" echo " Saved. Total tone entries: $total" _log "tone" "$input" fi ;; headline) shift if [ $# -eq 0 ]; then echo "Recent headline entries:" tail -20 "$DATA_DIR/headline.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator headline <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/headline.log" local total=$(wc -l < "$DATA_DIR/headline.log") echo " [Slideshow Generator] headline: $input" echo " Saved. Total headline entries: $total" _log "headline" "$input" fi ;; outline) shift if [ $# -eq 0 ]; then echo "Recent outline entries:" tail -20 "$DATA_DIR/outline.log" 2>/dev/null || echo " No entries yet. Use: slideshow-generator outline <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/outline.log" local total=$(wc -l < "$DATA_DIR/outline.log") echo " [Slideshow Generator] outline: $input" echo " Saved. Total outline entries: $total" _log "outline" "$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 'slideshow-generator help'" exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Deployer concepts, best practices, and implementation patterns.
--- name: "deployer" version: "2.0.2" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Deployer concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [deployer, reference] category: "devtools" --- # Deployer Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Deployer concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # deployer — Deployer reference tool. Use when working with deployer in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.1" show_help() { cat << 'HELPEOF' deployer v$VERSION — Deployer Reference Tool Usage: deployer <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Deployer — Overview ## What is Deployer? Deployer (deployer) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with deployer. ## Key Concepts - Core deployer principles and fundamentals - How deployer fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Deployer Matters Understanding deployer is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic deployer concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Deployer — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the deployer package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Deployer — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for deployer 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Deployer — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Deployer — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Deployer — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Deployer — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Deployer — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "deployer v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: deployer help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Mlfinlab concepts, best practices, and implementation patterns.
--- name: "mlfinlab" version: "2.0.2" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Mlfinlab concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [mlfinlab, reference] category: "devtools" --- # Mlfinlab Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Mlfinlab concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # mlfinlab — Mlfinlab reference tool. Use when working with mlfinlab in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.1" show_help() { cat << 'HELPEOF' mlfinlab v$VERSION — Mlfinlab Reference Tool Usage: mlfinlab <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Mlfinlab — Overview ## What is Mlfinlab? Mlfinlab (mlfinlab) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with mlfinlab. ## Key Concepts - Core mlfinlab principles and fundamentals - How mlfinlab fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Mlfinlab Matters Understanding mlfinlab is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic mlfinlab concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Mlfinlab — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the mlfinlab package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Mlfinlab — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for mlfinlab 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Mlfinlab — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Mlfinlab — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Mlfinlab — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Mlfinlab — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Mlfinlab — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "mlfinlab v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: mlfinlab help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Lunardate concepts, best practices, and implementation patterns.
--- name: "lunardate" version: "2.0.2" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Lunardate concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [lunardate, reference] category: "devtools" --- # Lunardate Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Lunardate concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # lunardate — Lunardate reference tool. Use when working with lunardate in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.1" show_help() { cat << 'HELPEOF' lunardate v$VERSION — Lunardate Reference Tool Usage: lunardate <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Lunardate — Overview ## What is Lunardate? Lunardate (lunardate) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with lunardate. ## Key Concepts - Core lunardate principles and fundamentals - How lunardate fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Lunardate Matters Understanding lunardate is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic lunardate concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Lunardate — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the lunardate package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Lunardate — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for lunardate 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Lunardate — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Lunardate — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Lunardate — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Lunardate — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Lunardate — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "lunardate v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: lunardate help"; exit 1 ;; esac
trace
--- name: "trace" version: "2.0.0" description: "trace" author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [trace, reference] category: "devtools" --- # Trace trace. No API keys or credentials required — outputs reference documentation only. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # trace — Trace reference tool. Use when working with trace in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.0" show_help() { cat << 'HELPEOF' trace v$VERSION — Trace Reference Tool Usage: trace <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Trace — Overview ## What is Trace? Trace (trace) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with trace. ## Key Concepts - Core trace principles and fundamentals - How trace fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Trace Matters Understanding trace is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic trace concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Trace — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the trace package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Trace — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for trace 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Trace — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Trace — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Trace — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Trace — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Trace — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "trace v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: trace help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Vector concepts, best practices, and implementation patterns.
--- name: "vector" version: "2.0.3" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Vector concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [vector, reference] category: "devtools" --- # Vector Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Vector concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # vector — Vector reference tool. Use when working with vector in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.2" show_help() { cat << 'HELPEOF' vector v$VERSION — Vector Reference Tool Usage: vector <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Vector — Overview ## What is Vector? Vector (vector) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with vector. ## Key Concepts - Core vector principles and fundamentals - How vector fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Vector Matters Understanding vector is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic vector concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Vector — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the vector package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Vector — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for vector 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Vector — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Vector — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Vector — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Vector — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Vector — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "vector v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: vector help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Schema concepts, best practices, and implementation patterns.
--- name: "schema" version: "2.0.1" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Schema concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [schema, reference] category: "devtools" --- # Schema Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Schema concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # schema — Schema reference tool. Use when working with schema in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.0" show_help() { cat << 'HELPEOF' schema v$VERSION — Schema Reference Tool Usage: schema <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Schema — Overview ## What is Schema? Schema (schema) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with schema. ## Key Concepts - Core schema principles and fundamentals - How schema fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Schema Matters Understanding schema is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic schema concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Schema — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the schema package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Schema — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for schema 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Schema — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Schema — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Schema — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Schema — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Schema — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "schema v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: schema help"; exit 1 ;; esac
Monitor network connectivity and diagnose latency issues using ping and traceroute. Use when troubleshooting network problems or checking host availability.
--- name: ping version: "1.0.0" description: "Monitor network connectivity and diagnose latency issues using ping and traceroute. Use when troubleshooting network problems or checking host availability." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: [network, ping, traceroute, latency, monitoring, connectivity, diagnostics] --- # Ping — Network Connectivity Tool A thorough network connectivity diagnostic tool that checks host availability, traces routes, sweeps subnets, monitors uptime, and analyzes latency patterns. All results are stored locally in JSONL format for historical analysis and reporting. ## Prerequisites - `ping` command (pre-installed on most systems) - `traceroute` or `tracepath` (for route tracing) - `python3` (for data processing and reporting) - `bash` 4.0+ ## Data Storage All ping results and configuration are stored in `~/.ping/`: - `~/.ping/data.jsonl` — historical ping results (JSONL format) - `~/.ping/config.json` — user configuration (default count, timeout, etc.) ## Commands ### `check` Check connectivity to a target host. Sends ICMP echo requests and records results. ```bash PING_TARGET="8.8.8.8" PING_COUNT="4" bash scripts/script.sh check ``` ### `trace` Trace the network route to a target host, showing each hop and latency. ```bash PING_TARGET="google.com" bash scripts/script.sh trace ``` ### `sweep` Sweep a subnet to discover responsive hosts. Scans a CIDR range. ```bash PING_SUBNET="192.168.1.0/24" bash scripts/script.sh sweep ``` ### `monitor` Continuously monitor a host and log results. Runs a configurable number of pings over time. ```bash PING_TARGET="8.8.8.8" PING_INTERVAL="5" PING_DURATION="60" bash scripts/script.sh monitor ``` ### `report` Generate a summary report from stored ping history for a specific target or all targets. ```bash PING_TARGET="8.8.8.8" bash scripts/script.sh report ``` ### `latency` Analyze latency statistics (min, max, avg, jitter, percentiles) for a target. ```bash PING_TARGET="8.8.8.8" bash scripts/script.sh latency ``` ### `compare` Compare connectivity and latency between multiple hosts side by side. ```bash PING_TARGETS="8.8.8.8,1.1.1.1,208.67.222.222" bash scripts/script.sh compare ``` ### `history` View stored ping history with optional filtering by target, date range, or status. ```bash PING_TARGET="8.8.8.8" PING_LIMIT="20" bash scripts/script.sh history ``` ### `export` Export ping history to CSV or JSON format. ```bash PING_FORMAT="csv" PING_OUTPUT="ping_report.csv" bash scripts/script.sh export ``` ### `config` View or update ping configuration (default count, timeout, interval). ```bash PING_KEY="count" PING_VALUE="10" bash scripts/script.sh config ``` ### `help` Show usage information and available commands. ```bash bash scripts/script.sh help ``` ### `version` Display the current version of the ping skill. ```bash bash scripts/script.sh version ``` ## Environment Variables | Variable | Description | Default | |---|---|---| | `PING_TARGET` | Target host or IP address | — | | `PING_TARGETS` | Comma-separated list of targets (for compare) | — | | `PING_COUNT` | Number of ping packets to send | `4` | | `PING_TIMEOUT` | Timeout in seconds per packet | `5` | | `PING_INTERVAL` | Seconds between pings (monitor mode) | `5` | | `PING_DURATION` | Total monitoring duration in seconds | `60` | | `PING_SUBNET` | CIDR notation subnet for sweep | — | | `PING_LIMIT` | Max records to display in history | `50` | | `PING_FORMAT` | Export format: `csv` or `json` | `json` | | `PING_OUTPUT` | Output file path for export | stdout | | `PING_KEY` | Config key to set | — | | `PING_VALUE` | Config value to set | — | ## Examples ```bash # Quick connectivity check PING_TARGET="google.com" bash scripts/script.sh check # Monitor DNS server for 5 minutes PING_TARGET="8.8.8.8" PING_INTERVAL="10" PING_DURATION="300" bash scripts/script.sh monitor # Compare DNS providers PING_TARGETS="8.8.8.8,1.1.1.1,9.9.9.9" bash scripts/script.sh compare # Export last week's data as CSV PING_FORMAT="csv" bash scripts/script.sh export ``` --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/script.sh #!/usr/bin/env bash # ping skill — Network Connectivity Tool # Version: 1.0.0 # Author: BytesAgain | https://bytesagain.com set -euo pipefail COMMAND="-help" DATA_DIR="$HOME/.ping" DATA_FILE="$DATA_DIR/data.jsonl" CONFIG_FILE="$DATA_DIR/config.json" mkdir -p "$DATA_DIR" touch "$DATA_FILE" # Initialize config if missing if [ ! -f "$CONFIG_FILE" ]; then cat > "$CONFIG_FILE" << 'EOF' {"count": 4, "timeout": 5, "interval": 5, "duration": 60} EOF fi # Read config defaults _get_config() { python3 << 'PYEOF' import json, os config_file = os.path.join(os.environ.get("HOME", ""), ".ping", "config.json") try: with open(config_file) as f: cfg = json.load(f) print(json.dumps(cfg)) except: print('{"count": 4, "timeout": 5, "interval": 5, "duration": 60}') PYEOF } case "$COMMAND" in check) python3 << 'PYEOF' import subprocess, json, os, time, re, sys target = os.environ.get("PING_TARGET", "") if not target: print("Error: PING_TARGET is required", file=sys.stderr) sys.exit(1) config_file = os.path.join(os.environ.get("HOME", ""), ".ping", "config.json") try: with open(config_file) as f: cfg = json.load(f) except: cfg = {} count = int(os.environ.get("PING_COUNT", cfg.get("count", 4))) timeout = int(os.environ.get("PING_TIMEOUT", cfg.get("timeout", 5))) print(f"🏓 Pinging {target} with {count} packets (timeout: {timeout}s)...") try: result = subprocess.run( ["ping", "-c", str(count), "-W", str(timeout), target], capture_output=True, text=True, timeout=count * timeout + 10 ) output = result.stdout + result.stderr success = result.returncode == 0 # Parse stats stats = {"target": target, "timestamp": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "success": success, "count": count, "type": "check"} # Parse packet loss loss_match = re.search(r'(\d+)% packet loss', output) if loss_match: stats["packet_loss"] = int(loss_match.group(1)) # Parse rtt rtt_match = re.search(r'rtt min/avg/max/mdev = ([\d.]+)/([\d.]+)/([\d.]+)/([\d.]+)', output) if not rtt_match: rtt_match = re.search(r'min/avg/max/(?:mdev|stddev) = ([\d.]+)/([\d.]+)/([\d.]+)/([\d.]+)', output) if rtt_match: stats["rtt_min"] = float(rtt_match.group(1)) stats["rtt_avg"] = float(rtt_match.group(2)) stats["rtt_max"] = float(rtt_match.group(3)) stats["rtt_mdev"] = float(rtt_match.group(4)) # Save to JSONL data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") with open(data_file, "a") as f: f.write(json.dumps(stats) + "\n") if success: print(f"✅ {target} is reachable") if "rtt_avg" in stats: print(f" RTT: min={stats['rtt_min']}ms avg={stats['rtt_avg']}ms max={stats['rtt_max']}ms") if "packet_loss" in stats: print(f" Packet loss: {stats['packet_loss']}%") else: print(f"❌ {target} is unreachable") if "packet_loss" in stats: print(f" Packet loss: {stats['packet_loss']}%") print(f"\n📝 Result saved to history") except subprocess.TimeoutExpired: print(f"❌ Ping to {target} timed out") record = {"target": target, "timestamp": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "success": False, "count": count, "type": "check", "error": "timeout"} data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") except Exception as e: print(f"❌ Error: {e}", file=sys.stderr) sys.exit(1) PYEOF ;; trace) python3 << 'PYEOF' import subprocess, json, os, time, sys, shutil target = os.environ.get("PING_TARGET", "") if not target: print("Error: PING_TARGET is required", file=sys.stderr) sys.exit(1) print(f"🔍 Tracing route to {target}...") # Try traceroute first, fallback to tracepath trace_cmd = None if shutil.which("traceroute"): trace_cmd = ["traceroute", "-m", "30", "-w", "3", target] elif shutil.which("tracepath"): trace_cmd = ["tracepath", target] else: print("Error: Neither traceroute nor tracepath found. Install traceroute.", file=sys.stderr) sys.exit(1) try: result = subprocess.run(trace_cmd, capture_output=True, text=True, timeout=120) output = result.stdout print(output) record = { "target": target, "timestamp": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "type": "trace", "success": result.returncode == 0, "hops": output.count("\n") - 1, "output_preview": output[:500] } data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") print(f"\n📝 Trace saved to history") except subprocess.TimeoutExpired: print(f"❌ Traceroute to {target} timed out (>120s)") except Exception as e: print(f"❌ Error: {e}", file=sys.stderr) sys.exit(1) PYEOF ;; sweep) python3 << 'PYEOF' import subprocess, json, os, time, sys, ipaddress, concurrent.futures subnet = os.environ.get("PING_SUBNET", "") if not subnet: print("Error: PING_SUBNET is required (e.g., 192.168.1.0/24)", file=sys.stderr) sys.exit(1) try: network = ipaddress.ip_network(subnet, strict=False) except ValueError as e: print(f"Error: Invalid subnet: {e}", file=sys.stderr) sys.exit(1) hosts = list(network.hosts()) if len(hosts) > 256: print(f"Warning: Subnet has {len(hosts)} hosts, limiting to first 256") hosts = hosts[:256] print(f"🔍 Sweeping {subnet} ({len(hosts)} hosts)...") def ping_host(ip): try: r = subprocess.run( ["ping", "-c", "1", "-W", "1", str(ip)], capture_output=True, text=True, timeout=5 ) return (str(ip), r.returncode == 0) except: return (str(ip), False) alive = [] with concurrent.futures.ThreadPoolExecutor(max_workers=50) as executor: futures = {executor.submit(ping_host, ip): ip for ip in hosts} for future in concurrent.futures.as_completed(futures): ip_str, is_up = future.result() if is_up: alive.append(ip_str) print(f" ✅ {ip_str}") alive.sort(key=lambda x: ipaddress.ip_address(x)) print(f"\n📊 Results: {len(alive)}/{len(hosts)} hosts alive") record = { "type": "sweep", "timestamp": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "subnet": subnet, "total_hosts": len(hosts), "alive_count": len(alive), "alive_hosts": alive } data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") print(f"📝 Sweep results saved to history") PYEOF ;; monitor) python3 << 'PYEOF' import subprocess, json, os, time, re, sys target = os.environ.get("PING_TARGET", "") if not target: print("Error: PING_TARGET is required", file=sys.stderr) sys.exit(1) interval = int(os.environ.get("PING_INTERVAL", "5")) duration = int(os.environ.get("PING_DURATION", "60")) print(f"📡 Monitoring {target} every {interval}s for {duration}s...") start_time = time.time() results = [] data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") while time.time() - start_time < duration: try: r = subprocess.run( ["ping", "-c", "1", "-W", "3", target], capture_output=True, text=True, timeout=10 ) success = r.returncode == 0 rtt = None rtt_match = re.search(r'time=([\d.]+)', r.stdout) if rtt_match: rtt = float(rtt_match.group(1)) ts = time.strftime("%H:%M:%S") if success and rtt is not None: print(f" [{ts}] ✅ {target} — {rtt}ms") elif success: print(f" [{ts}] ✅ {target} — OK") else: print(f" [{ts}] ❌ {target} — unreachable") results.append({"time": time.time(), "success": success, "rtt": rtt}) except: ts = time.strftime("%H:%M:%S") print(f" [{ts}] ❌ {target} — timeout") results.append({"time": time.time(), "success": False, "rtt": None}) remaining = duration - (time.time() - start_time) if remaining > interval: time.sleep(interval) else: break # Summary total = len(results) ok = sum(1 for r in results if r["success"]) rtts = [r["rtt"] for r in results if r["rtt"] is not None] print(f"\n📊 Monitor Summary:") print(f" Total pings: {total}") print(f" Success: {ok}/{total} ({ok*100//total if total else 0}%)") if rtts: print(f" RTT: min={min(rtts):.1f}ms avg={sum(rtts)/len(rtts):.1f}ms max={max(rtts):.1f}ms") record = { "type": "monitor", "target": target, "timestamp": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "duration": duration, "interval": interval, "total_pings": total, "success_count": ok, "avg_rtt": round(sum(rtts)/len(rtts), 2) if rtts else None, "min_rtt": min(rtts) if rtts else None, "max_rtt": max(rtts) if rtts else None } with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") print(f"📝 Monitor session saved to history") PYEOF ;; report) python3 << 'PYEOF' import json, os, sys from collections import defaultdict data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") target_filter = os.environ.get("PING_TARGET", "") if not os.path.exists(data_file) or os.path.getsize(data_file) == 0: print("📭 No ping history found. Run some checks first.") sys.exit(0) records = [] with open(data_file) as f: for line in f: line = line.strip() if line: try: r = json.loads(line) if target_filter and r.get("target") != target_filter: continue records.append(r) except: continue if not records: msg = f"for {target_filter}" if target_filter else "" print(f"📭 No records found {msg}") sys.exit(0) # Group by target by_target = defaultdict(list) for r in records: t = r.get("target", r.get("subnet", "unknown")) by_target[t].append(r) print("=" * 60) print("📊 PING REPORT") print("=" * 60) for target, recs in sorted(by_target.items()): checks = [r for r in recs if r.get("type") == "check"] monitors = [r for r in recs if r.get("type") == "monitor"] traces = [r for r in recs if r.get("type") == "trace"] sweeps = [r for r in recs if r.get("type") == "sweep"] print(f"\n🎯 Target: {target}") print(f" Total records: {len(recs)}") print(f" Checks: {len(checks)} | Monitors: {len(monitors)} | Traces: {len(traces)} | Sweeps: {len(sweeps)}") if checks: success = sum(1 for c in checks if c.get("success")) rtts = [c["rtt_avg"] for c in checks if "rtt_avg" in c] print(f" Check success rate: {success}/{len(checks)} ({success*100//len(checks)}%)") if rtts: print(f" Avg RTT: {sum(rtts)/len(rtts):.1f}ms") if recs: timestamps = [r.get("timestamp", "") for r in recs if r.get("timestamp")] if timestamps: print(f" First seen: {min(timestamps)}") print(f" Last seen: {max(timestamps)}") print(f"\n{'=' * 60}") print(f"Total targets: {len(by_target)} | Total records: {len(records)}") PYEOF ;; latency) python3 << 'PYEOF' import json, os, sys, math data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") target = os.environ.get("PING_TARGET", "") if not target: print("Error: PING_TARGET is required", file=sys.stderr) sys.exit(1) if not os.path.exists(data_file) or os.path.getsize(data_file) == 0: print("📭 No ping history found.") sys.exit(0) rtts = [] with open(data_file) as f: for line in f: line = line.strip() if not line: continue try: r = json.loads(line) if r.get("target") != target: continue if "rtt_avg" in r: rtts.append(r["rtt_avg"]) if "avg_rtt" in r and r["avg_rtt"] is not None: rtts.append(r["avg_rtt"]) except: continue if not rtts: print(f"📭 No latency data found for {target}") sys.exit(0) rtts.sort() n = len(rtts) avg = sum(rtts) / n variance = sum((x - avg) ** 2 for x in rtts) / n stddev = math.sqrt(variance) jitter = sum(abs(rtts[i] - rtts[i-1]) for i in range(1, n)) / (n - 1) if n > 1 else 0 p50 = rtts[int(n * 0.50)] if n > 0 else 0 p90 = rtts[int(n * 0.90)] if n > 0 else 0 p95 = rtts[min(int(n * 0.95), n-1)] if n > 0 else 0 p99 = rtts[min(int(n * 0.99), n-1)] if n > 0 else 0 print(f"📊 Latency Analysis for {target}") print(f"{'=' * 50}") print(f" Samples: {n}") print(f" Min: {min(rtts):.2f} ms") print(f" Max: {max(rtts):.2f} ms") print(f" Average: {avg:.2f} ms") print(f" Std Dev: {stddev:.2f} ms") print(f" Jitter: {jitter:.2f} ms") print(f" P50: {p50:.2f} ms") print(f" P90: {p90:.2f} ms") print(f" P95: {p95:.2f} ms") print(f" P99: {p99:.2f} ms") PYEOF ;; compare) python3 << 'PYEOF' import subprocess, json, os, time, re, sys targets_str = os.environ.get("PING_TARGETS", "") if not targets_str: print("Error: PING_TARGETS is required (comma-separated)", file=sys.stderr) sys.exit(1) targets = [t.strip() for t in targets_str.split(",") if t.strip()] count = int(os.environ.get("PING_COUNT", "4")) data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") print(f"🔄 Comparing {len(targets)} targets with {count} pings each...\n") results = [] for target in targets: try: r = subprocess.run( ["ping", "-c", str(count), "-W", "3", target], capture_output=True, text=True, timeout=count * 5 + 10 ) success = r.returncode == 0 rtt_match = re.search(r'rtt min/avg/max/mdev = ([\d.]+)/([\d.]+)/([\d.]+)/([\d.]+)', r.stdout) if not rtt_match: rtt_match = re.search(r'min/avg/max/(?:mdev|stddev) = ([\d.]+)/([\d.]+)/([\d.]+)/([\d.]+)', r.stdout) loss_match = re.search(r'(\d+)% packet loss', r.stdout) entry = {"target": target, "success": success} if rtt_match: entry["min"] = float(rtt_match.group(1)) entry["avg"] = float(rtt_match.group(2)) entry["max"] = float(rtt_match.group(3)) if loss_match: entry["loss"] = int(loss_match.group(1)) results.append(entry) except: results.append({"target": target, "success": False, "error": "timeout"}) # Display table print(f"{'Target':<25} {'Status':<10} {'Avg RTT':<12} {'Min RTT':<12} {'Max RTT':<12} {'Loss':<8}") print("-" * 79) for r in results: status = "✅ UP" if r["success"] else "❌ DOWN" avg = f"{r['avg']:.1f}ms" if "avg" in r else "N/A" mn = f"{r['min']:.1f}ms" if "min" in r else "N/A" mx = f"{r['max']:.1f}ms" if "max" in r else "N/A" loss = f"{r.get('loss', 'N/A')}%" print(f"{r['target']:<25} {status:<10} {avg:<12} {mn:<12} {mx:<12} {loss:<8}") # Rank by avg RTT ranked = sorted([r for r in results if "avg" in r], key=lambda x: x["avg"]) if ranked: print(f"\n🏆 Fastest: {ranked[0]['target']} ({ranked[0]['avg']:.1f}ms)") # Save comparison record = { "type": "compare", "timestamp": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "targets": targets, "results": results } with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") PYEOF ;; history) python3 << 'PYEOF' import json, os, sys data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") target_filter = os.environ.get("PING_TARGET", "") limit = int(os.environ.get("PING_LIMIT", "50")) if not os.path.exists(data_file) or os.path.getsize(data_file) == 0: print("📭 No ping history found.") sys.exit(0) records = [] with open(data_file) as f: for line in f: line = line.strip() if not line: continue try: r = json.loads(line) if target_filter and r.get("target") != target_filter: continue records.append(r) except: continue records = records[-limit:] print(f"📋 Ping History (showing {len(records)} records)") print("=" * 70) for r in records: ts = r.get("timestamp", "unknown") rtype = r.get("type", "unknown") target = r.get("target", r.get("subnet", "N/A")) success = "✅" if r.get("success") else "❌" detail = "" if "rtt_avg" in r: detail = f"avg={r['rtt_avg']}ms" elif "avg_rtt" in r and r["avg_rtt"] is not None: detail = f"avg={r['avg_rtt']}ms" elif "alive_count" in r: detail = f"{r['alive_count']}/{r['total_hosts']} alive" print(f" [{ts}] {success} {rtype:<8} {target:<25} {detail}") PYEOF ;; export) python3 << 'PYEOF' import json, os, sys, csv, io data_file = os.path.join(os.environ.get("HOME", ""), ".ping", "data.jsonl") fmt = os.environ.get("PING_FORMAT", "json").lower() output = os.environ.get("PING_OUTPUT", "") if not os.path.exists(data_file) or os.path.getsize(data_file) == 0: print("📭 No data to export.") sys.exit(0) records = [] with open(data_file) as f: for line in f: line = line.strip() if line: try: records.append(json.loads(line)) except: continue if fmt == "csv": all_keys = set() for r in records: all_keys.update(r.keys()) all_keys = sorted(all_keys) buf = io.StringIO() writer = csv.DictWriter(buf, fieldnames=all_keys, extrasaction='ignore') writer.writeheader() for r in records: row = {} for k in all_keys: v = r.get(k, "") if isinstance(v, (list, dict)): v = json.dumps(v) row[k] = v writer.writerow(row) content = buf.getvalue() elif fmt == "json": content = json.dumps(records, indent=2) else: print(f"Error: Unknown format '{fmt}'. Use 'csv' or 'json'.", file=sys.stderr) sys.exit(1) if output: with open(output, "w") as f: f.write(content) print(f"✅ Exported {len(records)} records to {output} ({fmt})") else: print(content) PYEOF ;; config) python3 << 'PYEOF' import json, os, sys config_file = os.path.join(os.environ.get("HOME", ""), ".ping", "config.json") key = os.environ.get("PING_KEY", "") value = os.environ.get("PING_VALUE", "") try: with open(config_file) as f: cfg = json.load(f) except: cfg = {"count": 4, "timeout": 5, "interval": 5, "duration": 60} if not key: print("⚙️ Ping Configuration:") for k, v in sorted(cfg.items()): print(f" {k}: {v}") sys.exit(0) if not value: if key in cfg: print(f"{key}: {cfg[key]}") else: print(f"Key '{key}' not found. Available: {', '.join(cfg.keys())}") sys.exit(0) # Try to parse value as number try: value = int(value) except ValueError: try: value = float(value) except ValueError: pass cfg[key] = value with open(config_file, "w") as f: json.dump(cfg, f, indent=2) print(f"✅ Set {key} = {value}") PYEOF ;; help) cat << 'HELPEOF' 🏓 Ping — Network Connectivity Tool v1.0.0 Usage: bash scripts/script.sh <command> Commands: check Check connectivity to a target host trace Trace network route to a target sweep Sweep a subnet for responsive hosts monitor Continuously monitor a host over time report Generate summary report from history latency Analyze latency statistics for a target compare Compare latency between multiple hosts history View stored ping history export Export data to CSV or JSON config View or update configuration help Show this help message version Show version Environment Variables: PING_TARGET Target host/IP PING_TARGETS Comma-separated targets (compare) PING_COUNT Number of packets (default: 4) PING_TIMEOUT Timeout in seconds (default: 5) PING_INTERVAL Monitor interval (default: 5) PING_DURATION Monitor duration (default: 60) PING_SUBNET CIDR subnet (sweep) PING_LIMIT Max history records (default: 50) PING_FORMAT Export format: csv|json (default: json) PING_OUTPUT Export output file path Powered by BytesAgain | bytesagain.com | [email protected] HELPEOF ;; version) echo "ping v1.0.0 — Network Connectivity Tool" echo "Powered by BytesAgain | bytesagain.com" ;; *) echo "Unknown command: $COMMAND" echo "Run 'bash scripts/script.sh help' for usage." exit 1 ;; esac
Generate and manage test data fixtures using CLI templates. Use when creating seed data, mock records, or reproducible test datasets.
---
name: fixture
version: "1.0.0"
description: "Generate and manage test data fixtures using CLI templates. Use when creating seed data, mock records, or reproducible test datasets."
author: BytesAgain
homepage: https://bytesagain.com
source: https://github.com/bytesagain/ai-skills
---
# Fixture — Test Data Fixture Generator
A CLI tool for generating, managing, and exporting test data fixtures. Create reproducible datasets from templates with seeded randomness for consistent test environments.
## Prerequisites
- Python 3.8+
- `bash` shell
- Write access to `~/.fixture/`
## Data Storage
All fixtures are stored in JSONL format at `~/.fixture/data.jsonl`. Templates are stored at `~/.fixture/templates.json`.
## Commands
Run commands via: `bash scripts/script.sh <command> [arguments...]`
### create
Create a new fixture record with specified fields and values.
```bash
bash scripts/script.sh create --name "test_user" --type user --fields '{"name":"Alice","email":"[email protected]","age":30}'
```
**Arguments:**
- `--name` — Fixture name/label (required)
- `--type` — Fixture type/category (required)
- `--fields` — JSON object of field values (required)
### load
Load fixtures from a JSON or JSONL file into the fixture store.
```bash
bash scripts/script.sh load --file fixtures.json
bash scripts/script.sh load --file data.jsonl --format jsonl
```
**Arguments:**
- `--file` — Input file path (required)
- `--format` — File format: `json`, `jsonl` (optional, default: auto-detect)
### dump
Dump all fixtures or filtered subset to stdout or a file.
```bash
bash scripts/script.sh dump
bash scripts/script.sh dump --type user --output users.json
```
**Arguments:**
- `--type` — Filter by fixture type (optional)
- `--output` — Output file path (optional, default: stdout)
### list
List all fixtures with summary information.
```bash
bash scripts/script.sh list
bash scripts/script.sh list --type user
```
**Arguments:**
- `--type` — Filter by fixture type (optional)
### seed
Generate multiple fixture records from a template with seeded random data.
```bash
bash scripts/script.sh seed --template user --count 10 --seed 42
```
**Arguments:**
- `--template` — Template name to use (required)
- `--count` — Number of records to generate (required)
- `--seed` — Random seed for reproducibility (optional)
### reset
Clear all fixtures or a specific type from the data store.
```bash
bash scripts/script.sh reset
bash scripts/script.sh reset --type user
```
**Arguments:**
- `--type` — Only reset fixtures of this type (optional)
- `--confirm` — Skip confirmation prompt (optional)
### template
Manage fixture templates: create, list, or show template definitions.
```bash
bash scripts/script.sh template --list
bash scripts/script.sh template --create user --schema '{"name":"string","email":"email","age":"int:18-65"}'
bash scripts/script.sh template --show user
```
**Arguments:**
- `--list` — List all templates (optional)
- `--create` — Create template with given name (optional)
- `--schema` — JSON schema for template creation (optional)
- `--show` — Show a specific template (optional)
### validate
Validate fixtures against their template schema.
```bash
bash scripts/script.sh validate
bash scripts/script.sh validate --type user
```
**Arguments:**
- `--type` — Validate only a specific type (optional)
### export
Export fixtures to various formats: JSON, JSONL, CSV, SQL.
```bash
bash scripts/script.sh export --output fixtures.csv --format csv
bash scripts/script.sh export --output seed.sql --format sql --table users
```
**Arguments:**
- `--output` — Output file path (required)
- `--format` — Export format: `json`, `jsonl`, `csv`, `sql` (required)
- `--table` — Table name for SQL export (optional)
### import
Import fixtures from external sources or standard formats.
```bash
bash scripts/script.sh import --file data.csv --type user
```
**Arguments:**
- `--file` — Input file path (required)
- `--type` — Assign fixture type (required)
### help
Display help information and list all available commands.
```bash
bash scripts/script.sh help
```
### version
Display the current tool version.
```bash
bash scripts/script.sh version
```
## Examples
```bash
# Create a template
bash scripts/script.sh template --create user --schema '{"name":"string","email":"email","age":"int:18-65"}'
# Seed 50 users
bash scripts/script.sh seed --template user --count 50 --seed 42
# List all fixtures
bash scripts/script.sh list
# Export to SQL
bash scripts/script.sh export --output seed.sql --format sql --table users
# Reset all data
bash scripts/script.sh reset --confirm
```
## Notes
- Templates define field types: `string`, `email`, `int:min-max`, `float:min-max`, `bool`, `uuid`, `date`
- Seeded generation guarantees identical output given the same seed
- Use `validate` to check fixtures match their template schema
- SQL export generates INSERT statements compatible with most databases
---
Powered by BytesAgain | bytesagain.com | [email protected]
FILE:scripts/script.sh
#!/usr/bin/env bash
set -euo pipefail
###############################################################################
# fixture — Test Data Fixture Generator
# Version: 1.0.0
# Powered by BytesAgain | bytesagain.com | [email protected]
###############################################################################
DATA_DIR="$HOME/.fixture"
DATA_FILE="$DATA_DIR/data.jsonl"
TEMPLATES_FILE="$DATA_DIR/templates.json"
mkdir -p "$DATA_DIR"
touch "$DATA_FILE"
[[ -f "$TEMPLATES_FILE" ]] || echo '{}' > "$TEMPLATES_FILE"
COMMAND="-help"
shift 2>/dev/null || true
case "$COMMAND" in
create)
NAME="" TYPE="" FIELDS=""
while [[ $# -gt 0 ]]; do
case "$1" in
--name) NAME="$2"; shift 2;;
--type) TYPE="$2"; shift 2;;
--fields) FIELDS="$2"; shift 2;;
*) shift;;
esac
done
if [[ -z "$NAME" || -z "$TYPE" || -z "$FIELDS" ]]; then
echo "Error: --name, --type, and --fields are required"
exit 1
fi
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_NAME="$NAME"
export FIXTURE_TYPE="$TYPE"
export FIXTURE_FIELDS="$FIELDS"
python3 << 'PYEOF'
import json, os, uuid, time
data_file = os.environ["FIXTURE_DATA_FILE"]
name = os.environ["FIXTURE_NAME"]
ftype = os.environ["FIXTURE_TYPE"]
fields = json.loads(os.environ["FIXTURE_FIELDS"])
record = {
"id": str(uuid.uuid4())[:8],
"name": name,
"type": ftype,
"fields": fields,
"created_at": time.strftime("%Y-%m-%dT%H:%M:%S")
}
with open(data_file, "a") as f:
f.write(json.dumps(record, ensure_ascii=False) + "\n")
print(f"✅ Fixture created: {record['id']}")
print(f" Name: {name}")
print(f" Type: {ftype}")
print(f" Fields: {json.dumps(fields, ensure_ascii=False)}")
PYEOF
;;
load)
FILE="" FORMAT=""
while [[ $# -gt 0 ]]; do
case "$1" in
--file) FILE="$2"; shift 2;;
--format) FORMAT="$2"; shift 2;;
*) shift;;
esac
done
if [[ -z "$FILE" ]]; then
echo "Error: --file is required"
exit 1
fi
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_INPUT_FILE="$FILE"
export FIXTURE_FORMAT="$FORMAT"
python3 << 'PYEOF'
import json, os, uuid, time
data_file = os.environ["FIXTURE_DATA_FILE"]
input_file = os.environ["FIXTURE_INPUT_FILE"]
fmt = os.environ.get("FIXTURE_FORMAT", "")
if not os.path.exists(input_file):
print(f"❌ File not found: {input_file}")
exit(1)
if not fmt:
fmt = "jsonl" if input_file.endswith(".jsonl") else "json"
count = 0
with open(input_file) as inf:
if fmt == "jsonl":
entries = [json.loads(line.strip()) for line in inf if line.strip()]
else:
entries = json.load(inf)
if isinstance(entries, dict):
entries = [entries]
with open(data_file, "a") as f:
for entry in entries:
if "id" not in entry:
entry["id"] = str(uuid.uuid4())[:8]
if "created_at" not in entry:
entry["created_at"] = time.strftime("%Y-%m-%dT%H:%M:%S")
f.write(json.dumps(entry, ensure_ascii=False) + "\n")
count += 1
print(f"✅ Loaded {count} fixtures from {input_file}")
PYEOF
;;
dump)
TYPE="" OUTPUT=""
while [[ $# -gt 0 ]]; do
case "$1" in
--type) TYPE="$2"; shift 2;;
--output) OUTPUT="$2"; shift 2;;
*) shift;;
esac
done
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_TYPE="$TYPE"
export FIXTURE_OUTPUT="$OUTPUT"
python3 << 'PYEOF'
import json, os, sys
data_file = os.environ["FIXTURE_DATA_FILE"]
ftype = os.environ.get("FIXTURE_TYPE", "")
output = os.environ.get("FIXTURE_OUTPUT", "")
entries = []
if os.path.exists(data_file):
with open(data_file) as f:
for line in f:
line = line.strip()
if line:
e = json.loads(line)
if not ftype or e.get("type") == ftype:
entries.append(e)
result = json.dumps(entries, indent=2, ensure_ascii=False)
if output:
with open(output, "w") as f:
f.write(result)
print(f"✅ Dumped {len(entries)} fixtures to {output}")
else:
print(result)
PYEOF
;;
list)
TYPE=""
while [[ $# -gt 0 ]]; do
case "$1" in
--type) TYPE="$2"; shift 2;;
*) shift;;
esac
done
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_TYPE="$TYPE"
python3 << 'PYEOF'
import json, os
from collections import Counter
data_file = os.environ["FIXTURE_DATA_FILE"]
ftype = os.environ.get("FIXTURE_TYPE", "")
entries = []
if os.path.exists(data_file):
with open(data_file) as f:
for line in f:
line = line.strip()
if line:
e = json.loads(line)
if not ftype or e.get("type") == ftype:
entries.append(e)
if not entries:
print("📋 No fixtures found.")
exit(0)
types = Counter(e.get("type", "unknown") for e in entries)
print(f"📋 Fixtures ({len(entries)} total)")
print(f" Types: {dict(types)}\n")
for e in entries[:20]:
fields_summary = list(e.get("fields", {}).keys()) if isinstance(e.get("fields"), dict) else []
print(f" [{e.get('id','')}] {e.get('name','')} ({e.get('type','')}) — {', '.join(fields_summary[:4])}")
if len(entries) > 20:
print(f"\n ... and {len(entries) - 20} more")
PYEOF
;;
seed)
TEMPLATE="" COUNT="" SEED=""
while [[ $# -gt 0 ]]; do
case "$1" in
--template) TEMPLATE="$2"; shift 2;;
--count) COUNT="$2"; shift 2;;
--seed) SEED="$2"; shift 2;;
*) shift;;
esac
done
if [[ -z "$TEMPLATE" || -z "$COUNT" ]]; then
echo "Error: --template and --count are required"
exit 1
fi
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_TEMPLATES_FILE="$TEMPLATES_FILE"
export FIXTURE_TEMPLATE="$TEMPLATE"
export FIXTURE_COUNT="$COUNT"
export FIXTURE_SEED="-"
python3 << 'PYEOF'
import json, os, uuid, time, random, string
data_file = os.environ["FIXTURE_DATA_FILE"]
templates_file = os.environ["FIXTURE_TEMPLATES_FILE"]
template_name = os.environ["FIXTURE_TEMPLATE"]
count = int(os.environ["FIXTURE_COUNT"])
seed_val = os.environ.get("FIXTURE_SEED", "")
if seed_val:
random.seed(int(seed_val))
with open(templates_file) as f:
templates = json.load(f)
if template_name not in templates:
print(f"❌ Template not found: {template_name}")
print(f" Available: {', '.join(templates.keys()) if templates else 'none'}")
exit(1)
schema = templates[template_name]
first_names = ["Alice", "Bob", "Charlie", "Diana", "Eve", "Frank", "Grace", "Henry", "Ivy", "Jack"]
last_names = ["Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller", "Davis", "Wilson", "Moore"]
domains = ["test.com", "example.org", "mock.dev", "fixture.io"]
def generate_value(field_type):
if field_type == "string":
return ''.join(random.choices(string.ascii_lowercase, k=random.randint(5, 15)))
elif field_type == "email":
name = random.choice(first_names).lower()
return f"{name}{random.randint(1,999)}@{random.choice(domains)}"
elif field_type.startswith("int:"):
lo, hi = field_type[4:].split("-")
return random.randint(int(lo), int(hi))
elif field_type.startswith("float:"):
lo, hi = field_type[6:].split("-")
return round(random.uniform(float(lo), float(hi)), 2)
elif field_type == "bool":
return random.choice([True, False])
elif field_type == "uuid":
return str(uuid.uuid4())
elif field_type == "date":
year = random.randint(2020, 2026)
month = random.randint(1, 12)
day = random.randint(1, 28)
return f"{year}-{month:02d}-{day:02d}"
elif field_type == "name":
return f"{random.choice(first_names)} {random.choice(last_names)}"
else:
return field_type
generated = 0
with open(data_file, "a") as f:
for i in range(count):
fields = {}
for field_name, field_type in schema.items():
fields[field_name] = generate_value(field_type)
record = {
"id": str(uuid.uuid4())[:8],
"name": f"{template_name}_{i+1}",
"type": template_name,
"fields": fields,
"created_at": time.strftime("%Y-%m-%dT%H:%M:%S"),
"seeded": True
}
f.write(json.dumps(record, ensure_ascii=False) + "\n")
generated += 1
print(f"✅ Generated {generated} fixtures from template '{template_name}'")
if seed_val:
print(f" Seed: {seed_val} (reproducible)")
PYEOF
;;
reset)
TYPE="" CONFIRM=""
while [[ $# -gt 0 ]]; do
case "$1" in
--type) TYPE="$2"; shift 2;;
--confirm) CONFIRM="1"; shift;;
*) shift;;
esac
done
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_TYPE="$TYPE"
export FIXTURE_CONFIRM="$CONFIRM"
python3 << 'PYEOF'
import json, os
data_file = os.environ["FIXTURE_DATA_FILE"]
ftype = os.environ.get("FIXTURE_TYPE", "")
confirm = os.environ.get("FIXTURE_CONFIRM", "") == "1"
if not os.path.exists(data_file):
print("📋 No data to reset.")
exit(0)
if ftype:
keep = []
removed = 0
with open(data_file) as f:
for line in f:
line = line.strip()
if line:
e = json.loads(line)
if e.get("type") == ftype:
removed += 1
else:
keep.append(line)
with open(data_file, "w") as f:
for line in keep:
f.write(line + "\n")
print(f"✅ Removed {removed} fixtures of type '{ftype}'")
print(f" Remaining: {len(keep)}")
else:
if not confirm:
with open(data_file) as f:
count = sum(1 for line in f if line.strip())
print(f"⚠️ This will delete ALL {count} fixtures.")
print(f" Run with --confirm to proceed.")
exit(0)
open(data_file, "w").close()
print("✅ All fixtures have been reset.")
PYEOF
;;
template)
LIST="" CREATE="" SCHEMA="" SHOW=""
while [[ $# -gt 0 ]]; do
case "$1" in
--list) LIST="1"; shift;;
--create) CREATE="$2"; shift 2;;
--schema) SCHEMA="$2"; shift 2;;
--show) SHOW="$2"; shift 2;;
*) shift;;
esac
done
export FIXTURE_TEMPLATES_FILE="$TEMPLATES_FILE"
export FIXTURE_LIST="$LIST"
export FIXTURE_CREATE="$CREATE"
export FIXTURE_SCHEMA="$SCHEMA"
export FIXTURE_SHOW="$SHOW"
python3 << 'PYEOF'
import json, os
templates_file = os.environ["FIXTURE_TEMPLATES_FILE"]
do_list = os.environ.get("FIXTURE_LIST", "") == "1"
create = os.environ.get("FIXTURE_CREATE", "")
schema = os.environ.get("FIXTURE_SCHEMA", "")
show = os.environ.get("FIXTURE_SHOW", "")
with open(templates_file) as f:
templates = json.load(f)
if do_list:
if not templates:
print("📋 No templates defined.")
else:
print(f"📋 Templates ({len(templates)}):")
for name, fields in templates.items():
print(f" {name}: {', '.join(f'{k}({v})' for k, v in fields.items())}")
elif show:
if show in templates:
print(f"📋 Template: {show}")
print(json.dumps(templates[show], indent=2))
else:
print(f"❌ Template not found: {show}")
elif create and schema:
templates[create] = json.loads(schema)
with open(templates_file, "w") as f:
json.dump(templates, f, indent=2)
print(f"✅ Template created: {create}")
print(f" Schema: {schema}")
else:
print("Usage: template --list | --create <name> --schema '<json>' | --show <name>")
PYEOF
;;
validate)
TYPE=""
while [[ $# -gt 0 ]]; do
case "$1" in
--type) TYPE="$2"; shift 2;;
*) shift;;
esac
done
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_TEMPLATES_FILE="$TEMPLATES_FILE"
export FIXTURE_TYPE="$TYPE"
python3 << 'PYEOF'
import json, os
data_file = os.environ["FIXTURE_DATA_FILE"]
templates_file = os.environ["FIXTURE_TEMPLATES_FILE"]
ftype = os.environ.get("FIXTURE_TYPE", "")
with open(templates_file) as f:
templates = json.load(f)
entries = []
if os.path.exists(data_file):
with open(data_file) as f:
for line in f:
line = line.strip()
if line:
e = json.loads(line)
if not ftype or e.get("type") == ftype:
entries.append(e)
if not entries:
print("⚠️ No fixtures to validate.")
exit(0)
errors = []
warnings = []
for e in entries:
etype = e.get("type", "")
if etype in templates:
schema = templates[etype]
fields = e.get("fields", {})
for field_name in schema:
if field_name not in fields:
errors.append(f"Entry {e['id']}: Missing field '{field_name}'")
for field_name in fields:
if field_name not in schema:
warnings.append(f"Entry {e['id']}: Extra field '{field_name}'")
else:
warnings.append(f"Entry {e['id']}: No template for type '{etype}'")
if not e.get("id"):
errors.append(f"Entry missing ID")
if not e.get("fields"):
errors.append(f"Entry {e.get('id','?')}: Empty fields")
print(f"📊 Validation ({len(entries)} fixtures)")
print(f" Errors: {len(errors)}")
print(f" Warnings: {len(warnings)}")
if errors:
print("\n❌ Errors:")
for err in errors[:15]:
print(f" • {err}")
if warnings:
print("\n⚠️ Warnings:")
for w in warnings[:15]:
print(f" • {w}")
if not errors and not warnings:
print("✅ All fixtures valid!")
PYEOF
;;
export)
OUTPUT="" FORMAT=""
while [[ $# -gt 0 ]]; do
case "$1" in
--output) OUTPUT="$2"; shift 2;;
--format) FORMAT="$2"; shift 2;;
--table) export FIXTURE_TABLE="$2"; shift 2;;
*) shift;;
esac
done
if [[ -z "$OUTPUT" || -z "$FORMAT" ]]; then
echo "Error: --output and --format are required"
exit 1
fi
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_OUTPUT="$OUTPUT"
export FIXTURE_FORMAT="$FORMAT"
python3 << 'PYEOF'
import json, os, csv
data_file = os.environ["FIXTURE_DATA_FILE"]
output = os.environ["FIXTURE_OUTPUT"]
fmt = os.environ["FIXTURE_FORMAT"]
table = os.environ.get("FIXTURE_TABLE", "fixtures")
entries = []
if os.path.exists(data_file):
with open(data_file) as f:
for line in f:
line = line.strip()
if line:
entries.append(json.loads(line))
if not entries:
print("⚠️ No fixtures to export.")
exit(0)
with open(output, "w") as f:
if fmt == "json":
json.dump(entries, f, indent=2, ensure_ascii=False)
elif fmt == "jsonl":
for e in entries:
f.write(json.dumps(e, ensure_ascii=False) + "\n")
elif fmt == "csv":
all_keys = set()
for e in entries:
if isinstance(e.get("fields"), dict):
all_keys.update(e["fields"].keys())
all_keys = sorted(all_keys)
writer = csv.writer(f)
writer.writerow(["id", "name", "type"] + list(all_keys))
for e in entries:
fields = e.get("fields", {})
row = [e.get("id",""), e.get("name",""), e.get("type","")]
row += [fields.get(k, "") for k in all_keys]
writer.writerow(row)
elif fmt == "sql":
for e in entries:
fields = e.get("fields", {})
if fields:
cols = ", ".join(fields.keys())
vals = ", ".join(f"'{v}'" if isinstance(v, str) else str(v) for v in fields.values())
f.write(f"INSERT INTO {table} ({cols}) VALUES ({vals});\n")
print(f"✅ Exported {len(entries)} fixtures to {output} (format: {fmt})")
PYEOF
;;
import)
FILE="" TYPE=""
while [[ $# -gt 0 ]]; do
case "$1" in
--file) FILE="$2"; shift 2;;
--type) TYPE="$2"; shift 2;;
*) shift;;
esac
done
if [[ -z "$FILE" || -z "$TYPE" ]]; then
echo "Error: --file and --type are required"
exit 1
fi
export FIXTURE_DATA_FILE="$DATA_FILE"
export FIXTURE_INPUT_FILE="$FILE"
export FIXTURE_TYPE="$TYPE"
python3 << 'PYEOF'
import json, os, uuid, time, csv
data_file = os.environ["FIXTURE_DATA_FILE"]
input_file = os.environ["FIXTURE_INPUT_FILE"]
ftype = os.environ["FIXTURE_TYPE"]
if not os.path.exists(input_file):
print(f"❌ File not found: {input_file}")
exit(1)
count = 0
with open(data_file, "a") as out:
if input_file.endswith(".csv"):
with open(input_file) as f:
reader = csv.DictReader(f)
for row in reader:
record = {
"id": str(uuid.uuid4())[:8],
"name": f"{ftype}_{count+1}",
"type": ftype,
"fields": dict(row),
"created_at": time.strftime("%Y-%m-%dT%H:%M:%S"),
"imported": True
}
out.write(json.dumps(record, ensure_ascii=False) + "\n")
count += 1
elif input_file.endswith(".jsonl"):
with open(input_file) as f:
for line in f:
line = line.strip()
if line:
data = json.loads(line)
record = {
"id": str(uuid.uuid4())[:8],
"name": f"{ftype}_{count+1}",
"type": ftype,
"fields": data if isinstance(data, dict) else {"value": data},
"created_at": time.strftime("%Y-%m-%dT%H:%M:%S"),
"imported": True
}
out.write(json.dumps(record, ensure_ascii=False) + "\n")
count += 1
else:
with open(input_file) as f:
data = json.load(f)
if isinstance(data, list):
for item in data:
record = {
"id": str(uuid.uuid4())[:8],
"name": f"{ftype}_{count+1}",
"type": ftype,
"fields": item if isinstance(item, dict) else {"value": item},
"created_at": time.strftime("%Y-%m-%dT%H:%M:%S"),
"imported": True
}
out.write(json.dumps(record, ensure_ascii=False) + "\n")
count += 1
print(f"✅ Imported {count} records as type '{ftype}'")
PYEOF
;;
help)
cat << 'HELPEOF'
fixture — Test Data Fixture Generator v1.0.0
Commands:
create Create a new fixture record
load Load fixtures from a file
dump Dump fixtures to stdout or file
list List all fixtures
seed Generate fixtures from template
reset Clear fixture data
template Manage fixture templates
validate Validate fixtures against schema
export Export fixtures to various formats
import Import fixtures from external files
help Show this help message
version Show version
Usage: bash scripts/script.sh <command> [options]
Powered by BytesAgain | bytesagain.com | [email protected]
HELPEOF
;;
version)
echo "fixture v1.0.0"
;;
*)
echo "Unknown command: $COMMAND"
echo "Run 'bash scripts/script.sh help' for usage."
exit 1
;;
esac
Calculate compound interest and investment growth using financial formulas. Use when you need to plan savings, compare rates, or project wealth.
--- name: compound version: "1.0.0" description: "Calculate compound interest and investment growth using financial formulas. Use when you need to plan savings, compare rates, or project wealth." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: [finance, compound-interest, calculator, investment, savings, planning] --- # Compound — Compound Interest Calculator Compound is a command-line compound interest calculator that helps you plan investments, compare interest rates, build amortization schedules, and project financial growth over time. All calculation history is stored in `~/.compound/data.jsonl` as JSONL records for future reference and comparison. ## Prerequisites - Python 3.8+ with standard library - `bash` shell ## Commands ### `calculate` Calculate compound interest for a given principal, rate, and time period. **Environment Variables:** - `PRINCIPAL` (required) — Initial investment amount - `RATE` (required) — Annual interest rate as percentage (e.g., 5.5) - `YEARS` (required) — Number of years - `FREQUENCY` — Compounding frequency: `daily`, `monthly`, `quarterly`, `annually` (default: monthly) - `CONTRIBUTION` — Regular contribution amount (default: 0) - `CONTRIB_FREQ` — Contribution frequency: `monthly`, `quarterly`, `annually` (default: monthly) **Example:** ```bash PRINCIPAL=10000 RATE=7.5 YEARS=20 FREQUENCY=monthly bash scripts/script.sh calculate ``` ### `compare` Compare multiple interest rate or compounding frequency scenarios side by side. **Environment Variables:** - `PRINCIPAL` (required) — Initial investment amount - `RATES` (required) — Comma-separated list of rates to compare (e.g., "3,5,7,10") - `YEARS` (required) — Number of years - `FREQUENCY` — Compounding frequency (default: monthly) ### `schedule` Generate a detailed payment/growth schedule showing balances at each period. **Environment Variables:** - `PRINCIPAL` (required) — Initial investment amount - `RATE` (required) — Annual interest rate as percentage - `YEARS` (required) — Number of years - `FREQUENCY` — Compounding frequency (default: monthly) - `CONTRIBUTION` — Regular contribution amount (default: 0) ### `table` Display a year-by-year summary table of investment growth. **Environment Variables:** - `PRINCIPAL` (required) — Initial investment amount - `RATE` (required) — Annual interest rate - `YEARS` (required) — Number of years - `CONTRIBUTION` — Regular contribution (default: 0) ### `rate` Calculate the required interest rate to reach a financial goal. **Environment Variables:** - `PRINCIPAL` (required) — Starting amount - `TARGET` (required) — Target amount - `YEARS` (required) — Time period in years - `FREQUENCY` — Compounding frequency (default: monthly) ### `goal` Calculate how long it takes to reach a savings goal. **Environment Variables:** - `PRINCIPAL` (required) — Starting amount - `TARGET` (required) — Goal amount - `RATE` (required) — Annual interest rate - `CONTRIBUTION` — Regular contribution (default: 0) ### `chart` Generate an ASCII chart of investment growth over time. **Environment Variables:** - `PRINCIPAL` (required) — Initial amount - `RATE` (required) — Annual interest rate - `YEARS` (required) — Number of years - `WIDTH` — Chart width in characters (default: 60) - `HEIGHT` — Chart height in lines (default: 20) ### `export` Export calculation history to a file. **Environment Variables:** - `OUTPUT` — Output file path (default: stdout) - `FORMAT` — Export format: `json`, `csv`, `jsonl` (default: json) - `CALC_ID` — Specific calculation ID to export (default: all) ### `config` View or update default configuration settings. **Environment Variables:** - `KEY` — Configuration key to set - `VALUE` — Configuration value ### `history` View past calculations with their results. **Environment Variables:** - `LIMIT` — Maximum entries to display (default: 20) - `SORT` — Sort by: `date`, `principal`, `rate`, `total` (default: date) ### `help` Display usage information and available commands. ### `version` Display the current version of the compound tool. ## Data Storage All calculations are stored in `~/.compound/data.jsonl`. Each line is a JSON object with fields: - `id` — Unique calculation identifier - `timestamp` — ISO 8601 creation time - `type` — Calculation type (calculate, compare, goal, etc.) - `params` — Input parameters - `result` — Calculation results (final amount, interest earned, etc.) ## Configuration Config stored in `~/.compound/config.json`: - `default_frequency` — Default compounding frequency (default: monthly) - `currency_symbol` — Currency symbol for display (default: $) - `decimal_places` — Number of decimal places (default: 2) --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/script.sh #!/usr/bin/env bash # Compound — Compound Interest Calculator # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail DATA_DIR="$HOME/.compound" DATA_FILE="$DATA_DIR/data.jsonl" CONFIG_FILE="$DATA_DIR/config.json" VERSION="1.0.0" mkdir -p "$DATA_DIR" touch "$DATA_FILE" if [ ! -f "$CONFIG_FILE" ]; then cat > "$CONFIG_FILE" << 'EOF' {"default_frequency": "monthly", "currency_symbol": "$", "decimal_places": 2} EOF fi COMMAND="-help" case "$COMMAND" in calculate) python3 << 'PYEOF' import os, json, uuid, sys, math from datetime import datetime data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) principal = os.environ.get("PRINCIPAL", "") rate = os.environ.get("RATE", "") years = os.environ.get("YEARS", "") frequency = os.environ.get("FREQUENCY", "monthly") contribution = float(os.environ.get("CONTRIBUTION", "0")) contrib_freq = os.environ.get("CONTRIB_FREQ", "monthly") try: with open(config_file) as f: cfg = json.load(f) if "FREQUENCY" not in os.environ: frequency = cfg.get("default_frequency", "monthly") symbol = cfg.get("currency_symbol", "$") dp = cfg.get("decimal_places", 2) except: symbol = "$" dp = 2 if not principal or not rate or not years: print("ERROR: PRINCIPAL, RATE, and YEARS environment variables are required") print("Usage: PRINCIPAL=10000 RATE=7.5 YEARS=20 bash scripts/script.sh calculate") sys.exit(1) principal = float(principal) rate = float(rate) / 100 years = float(years) freq_map = {"daily": 365, "monthly": 12, "quarterly": 4, "annually": 1} n = freq_map.get(frequency, 12) contrib_freq_map = {"monthly": 12, "quarterly": 4, "annually": 1} cn = contrib_freq_map.get(contrib_freq, 12) # Compound interest: A = P(1 + r/n)^(nt) total_periods = int(n * years) rate_per_period = rate / n if contribution > 0: # With regular contributions balance = principal total_contributions = principal contrib_period_ratio = n / cn # how many compound periods per contribution for period in range(1, total_periods + 1): balance *= (1 + rate_per_period) if period % int(contrib_period_ratio) == 0: balance += contribution total_contributions += contribution final_amount = balance else: final_amount = principal * (1 + rate_per_period) ** total_periods total_contributions = principal interest_earned = final_amount - total_contributions growth_pct = ((final_amount / principal) - 1) * 100 print(f"Compound Interest Calculation") print(f"{'='*50}") print(f"Principal: {symbol}{principal:>14,.{dp}f}") print(f"Annual Rate: {rate*100:>14.2f}%") print(f"Time Period: {years:>14.1f} years") print(f"Compounding: {frequency:>14}") if contribution > 0: print(f"Contribution: {symbol}{contribution:>14,.{dp}f} ({contrib_freq})") print(f"Total Contributed: {symbol}{total_contributions:>14,.{dp}f}") print(f"{'='*50}") print(f"Final Amount: {symbol}{final_amount:>14,.{dp}f}") print(f"Interest Earned: {symbol}{interest_earned:>14,.{dp}f}") print(f"Growth: {growth_pct:>14.2f}%") # Save to history calc_id = uuid.uuid4().hex[:12] record = { "id": calc_id, "timestamp": datetime.now().isoformat(), "type": "calculate", "params": { "principal": principal, "rate": rate * 100, "years": years, "frequency": frequency, "contribution": contribution, "contrib_freq": contrib_freq }, "result": { "final_amount": round(final_amount, dp), "interest_earned": round(interest_earned, dp), "total_contributions": round(total_contributions, dp), "growth_pct": round(growth_pct, 2) } } with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") print(f"\nCalculation ID: {calc_id}") PYEOF ;; compare) python3 << 'PYEOF' import os, json, uuid, sys from datetime import datetime data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) principal = os.environ.get("PRINCIPAL", "") rates_str = os.environ.get("RATES", "") years = os.environ.get("YEARS", "") frequency = os.environ.get("FREQUENCY", "monthly") try: with open(config_file) as f: cfg = json.load(f) symbol = cfg.get("currency_symbol", "$") dp = cfg.get("decimal_places", 2) except: symbol = "$" dp = 2 if not principal or not rates_str or not years: print("ERROR: PRINCIPAL, RATES, and YEARS are required") print("Usage: PRINCIPAL=10000 RATES='3,5,7,10' YEARS=20 bash scripts/script.sh compare") sys.exit(1) principal = float(principal) rates = [float(r.strip()) for r in rates_str.split(",")] years = float(years) freq_map = {"daily": 365, "monthly": 12, "quarterly": 4, "annually": 1} n = freq_map.get(frequency, 12) print(f"Rate Comparison — {symbol}{principal:,.{dp}f} over {years:.0f} years ({frequency} compounding)") print(f"{'='*70}") print(f"{'Rate':>8} {'Final Amount':>16} {'Interest':>16} {'Growth':>10}") print(f"{'-'*70}") results = [] for rate in rates: r = rate / 100 final = principal * (1 + r / n) ** (n * years) interest = final - principal growth = ((final / principal) - 1) * 100 print(f"{rate:>7.2f}% {symbol}{final:>15,.{dp}f} {symbol}{interest:>15,.{dp}f} {growth:>9.2f}%") results.append({"rate": rate, "final": round(final, dp), "interest": round(interest, dp), "growth": round(growth, 2)}) if len(rates) >= 2: diff = results[-1]["final"] - results[0]["final"] print(f"\nDifference between {rates[0]}% and {rates[-1]}%: {symbol}{diff:,.{dp}f}") calc_id = uuid.uuid4().hex[:12] record = { "id": calc_id, "timestamp": datetime.now().isoformat(), "type": "compare", "params": {"principal": principal, "rates": rates, "years": years, "frequency": frequency}, "result": {"comparisons": results} } with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") PYEOF ;; schedule) python3 << 'PYEOF' import os, json, uuid, sys from datetime import datetime data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) principal = os.environ.get("PRINCIPAL", "") rate = os.environ.get("RATE", "") years = os.environ.get("YEARS", "") frequency = os.environ.get("FREQUENCY", "monthly") contribution = float(os.environ.get("CONTRIBUTION", "0")) try: with open(config_file) as f: cfg = json.load(f) symbol = cfg.get("currency_symbol", "$") dp = cfg.get("decimal_places", 2) except: symbol = "$" dp = 2 if not principal or not rate or not years: print("ERROR: PRINCIPAL, RATE, and YEARS are required") sys.exit(1) principal = float(principal) rate = float(rate) / 100 years = float(years) freq_map = {"daily": 365, "monthly": 12, "quarterly": 4, "annually": 1} n = freq_map.get(frequency, 12) total_periods = int(n * years) rate_per_period = rate / n period_names = {"daily": "Day", "monthly": "Month", "quarterly": "Quarter", "annually": "Year"} pname = period_names.get(frequency, "Period") # Limit display for daily show_every = 1 if frequency == "daily" and total_periods > 100: show_every = 30 print(f"(Showing every 30 days for readability)") print(f"Growth Schedule — {symbol}{principal:,.{dp}f} at {rate*100:.2f}% ({frequency})") if contribution > 0: print(f"Regular contribution: {symbol}{contribution:,.{dp}f}") print(f"{'='*70}") print(f"{'Period':>8} {'Balance':>16} {'Interest':>14} {'Cumul. Interest':>16}") print(f"{'-'*70}") balance = principal cumulative_interest = 0 schedule_data = [] for period in range(1, total_periods + 1): interest = balance * rate_per_period balance += interest if contribution > 0: balance += contribution cumulative_interest += interest entry = {"period": period, "balance": round(balance, dp), "interest": round(interest, dp), "cumulative": round(cumulative_interest, dp)} schedule_data.append(entry) if period % show_every == 0 or period == total_periods: print(f"{period:>8} {symbol}{balance:>15,.{dp}f} {symbol}{interest:>13,.{dp}f} {symbol}{cumulative_interest:>15,.{dp}f}") print(f"\nFinal balance: {symbol}{balance:,.{dp}f}") print(f"Total interest earned: {symbol}{cumulative_interest:,.{dp}f}") calc_id = uuid.uuid4().hex[:12] record = { "id": calc_id, "timestamp": datetime.now().isoformat(), "type": "schedule", "params": {"principal": principal * (100 / (rate * 100 + 100)), "rate": rate * 100, "years": years, "frequency": frequency, "contribution": contribution}, "result": {"final_balance": round(balance, dp), "total_interest": round(cumulative_interest, dp), "periods": total_periods} } with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") PYEOF ;; table) python3 << 'PYEOF' import os, json, uuid, sys from datetime import datetime data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) principal = os.environ.get("PRINCIPAL", "") rate = os.environ.get("RATE", "") years = os.environ.get("YEARS", "") contribution = float(os.environ.get("CONTRIBUTION", "0")) try: with open(config_file) as f: cfg = json.load(f) symbol = cfg.get("currency_symbol", "$") dp = cfg.get("decimal_places", 2) except: symbol = "$" dp = 2 if not principal or not rate or not years: print("ERROR: PRINCIPAL, RATE, and YEARS are required") sys.exit(1) principal = float(principal) r = float(rate) / 100 years = int(float(years)) print(f"Year-by-Year Growth Table") print(f"Principal: {symbol}{principal:,.{dp}f} | Rate: {float(rate):.2f}% | Contributions: {symbol}{contribution:,.{dp}f}/yr") print(f"{'='*75}") print(f"{'Year':>5} {'Start Balance':>16} {'Interest':>14} {'Contribution':>14} {'End Balance':>16}") print(f"{'-'*75}") balance = principal total_interest = 0 total_contrib = 0 for year in range(1, years + 1): start = balance interest = balance * r balance += interest + contribution total_interest += interest total_contrib += contribution print(f"{year:>5} {symbol}{start:>15,.{dp}f} {symbol}{interest:>13,.{dp}f} {symbol}{contribution:>13,.{dp}f} {symbol}{balance:>15,.{dp}f}") print(f"{'='*75}") print(f"{'Total':>5} {'':>16} {symbol}{total_interest:>13,.{dp}f} {symbol}{total_contrib:>13,.{dp}f} {symbol}{balance:>15,.{dp}f}") PYEOF ;; rate) python3 << 'PYEOF' import os, json, uuid, sys, math from datetime import datetime data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) principal = os.environ.get("PRINCIPAL", "") target = os.environ.get("TARGET", "") years = os.environ.get("YEARS", "") frequency = os.environ.get("FREQUENCY", "monthly") try: with open(config_file) as f: cfg = json.load(f) symbol = cfg.get("currency_symbol", "$") except: symbol = "$" if not principal or not target or not years: print("ERROR: PRINCIPAL, TARGET, and YEARS are required") sys.exit(1) principal = float(principal) target = float(target) years = float(years) freq_map = {"daily": 365, "monthly": 12, "quarterly": 4, "annually": 1} n = freq_map.get(frequency, 12) # r = n * ((target/principal)^(1/(n*t)) - 1) required_rate = n * (math.pow(target / principal, 1 / (n * years)) - 1) required_pct = required_rate * 100 print(f"Required Rate Calculation") print(f"{'='*50}") print(f"Starting amount: {symbol}{principal:>14,.2f}") print(f"Target amount: {symbol}{target:>14,.2f}") print(f"Time period: {years:>14.1f} years") print(f"Compounding: {frequency:>14}") print(f"{'='*50}") print(f"Required rate: {required_pct:>14.4f}%") print(f"\nYou need an annual rate of {required_pct:.4f}% to grow") print(f"{symbol}{principal:,.2f} to {symbol}{target:,.2f} in {years:.0f} years.") calc_id = uuid.uuid4().hex[:12] record = { "id": calc_id, "timestamp": datetime.now().isoformat(), "type": "rate", "params": {"principal": principal, "target": target, "years": years, "frequency": frequency}, "result": {"required_rate": round(required_pct, 4)} } with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") PYEOF ;; goal) python3 << 'PYEOF' import os, json, uuid, sys, math from datetime import datetime data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) principal = os.environ.get("PRINCIPAL", "") target = os.environ.get("TARGET", "") rate = os.environ.get("RATE", "") contribution = float(os.environ.get("CONTRIBUTION", "0")) try: with open(config_file) as f: cfg = json.load(f) symbol = cfg.get("currency_symbol", "$") except: symbol = "$" if not principal or not target or not rate: print("ERROR: PRINCIPAL, TARGET, and RATE are required") sys.exit(1) principal = float(principal) target = float(target) rate = float(rate) / 100 if rate <= 0: print("ERROR: Rate must be positive") sys.exit(1) if contribution > 0: # Simulate month by month balance = principal months = 0 while balance < target and months < 12000: balance += balance * (rate / 12) balance += contribution months += 1 years = months / 12 else: # t = ln(target/principal) / (n * ln(1 + r/n)) n = 12 years = math.log(target / principal) / (n * math.log(1 + rate / n)) years_int = int(years) months_remaining = int((years - years_int) * 12) print(f"Goal Calculation") print(f"{'='*50}") print(f"Starting amount: {symbol}{principal:>14,.2f}") print(f"Goal amount: {symbol}{target:>14,.2f}") print(f"Annual rate: {rate*100:>14.2f}%") if contribution > 0: print(f"Monthly contrib: {symbol}{contribution:>14,.2f}") print(f"{'='*50}") print(f"Time to goal: {years_int} years, {months_remaining} months") print(f" ({years:.2f} years total)") calc_id = uuid.uuid4().hex[:12] record = { "id": calc_id, "timestamp": datetime.now().isoformat(), "type": "goal", "params": {"principal": principal, "target": target, "rate": rate * 100, "contribution": contribution}, "result": {"years": round(years, 2), "years_int": years_int, "months_remaining": months_remaining} } with open(data_file, "a") as f: f.write(json.dumps(record) + "\n") PYEOF ;; chart) python3 << 'PYEOF' import os, json, sys config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) principal = os.environ.get("PRINCIPAL", "") rate = os.environ.get("RATE", "") years = os.environ.get("YEARS", "") width = int(os.environ.get("WIDTH", "60")) height = int(os.environ.get("HEIGHT", "20")) try: with open(config_file) as f: cfg = json.load(f) symbol = cfg.get("currency_symbol", "$") except: symbol = "$" if not principal or not rate or not years: print("ERROR: PRINCIPAL, RATE, and YEARS are required") sys.exit(1) principal = float(principal) r = float(rate) / 100 years = int(float(years)) # Calculate yearly values values = [principal] balance = principal for y in range(1, years + 1): balance *= (1 + r) values.append(balance) # Also track principal-only line principal_line = [principal * (y + 1) / 1 for y in range(years + 1)] max_val = max(values) min_val = min(values) val_range = max_val - min_val if max_val != min_val else 1 print(f"Investment Growth Chart — {symbol}{principal:,.0f} at {r*100:.1f}%") print(f"{'='*width}") # ASCII chart for row in range(height - 1, -1, -1): threshold = min_val + (val_range * row / (height - 1)) label = f"{symbol}{threshold:>12,.0f} |" line = "" for col in range(len(values)): x_pos = int(col * (width - 16) / max(len(values) - 1, 1)) if len(line) <= x_pos: line += " " * (x_pos - len(line)) if values[col] >= threshold: line += "█" else: line += " " # Pad line line = line.ljust(width - 16) print(f"{label}{line}") # X-axis x_axis = " " * 15 + "+" + "-" * (width - 16) print(x_axis) x_labels = " " * 15 step = max(1, years // 10) for y in range(0, years + 1, step): pos = int(y * (width - 16) / max(years, 1)) while len(x_labels) < 15 + pos: x_labels += " " x_labels += str(y) print(x_labels + " years") print(f"\nStart: {symbol}{principal:,.2f} → End: {symbol}{values[-1]:,.2f}") print(f"Total growth: {((values[-1]/principal)-1)*100:.1f}%") PYEOF ;; export) python3 << 'PYEOF' import os, json, sys data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) output = os.environ.get("OUTPUT", "") fmt = os.environ.get("FORMAT", "json") calc_id = os.environ.get("CALC_ID", "") records = [] try: with open(data_file) as f: for line in f: line = line.strip() if line: rec = json.loads(line) if calc_id and rec.get("id") != calc_id: continue records.append(rec) except FileNotFoundError: pass if not records: print("No records found to export") sys.exit(0) if fmt == "json": result = json.dumps(records if not calc_id else records[0], indent=2) elif fmt == "csv": lines = ["id,timestamp,type,principal,rate,years,final_amount,interest_earned"] for r in records: p = r.get("params", {}) res = r.get("result", {}) lines.append(f"{r.get('id','')},{r.get('timestamp','')},{r.get('type','')},{p.get('principal','')},{p.get('rate','')},{p.get('years','')},{res.get('final_amount','')},{res.get('interest_earned','')}") result = "\n".join(lines) else: result = "\n".join(json.dumps(r) for r in records) if output: with open(output, "w") as f: f.write(result + "\n") print(f"Exported {len(records)} records to {output}") else: print(result) PYEOF ;; config) python3 << 'PYEOF' import os, json, sys config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) key = os.environ.get("KEY", "") value = os.environ.get("VALUE", "") try: with open(config_file) as f: cfg = json.load(f) except: cfg = {"default_frequency": "monthly", "currency_symbol": "$", "decimal_places": 2} if key and value: try: value = int(value) except ValueError: try: value = float(value) except ValueError: pass cfg[key] = value with open(config_file, "w") as f: json.dump(cfg, f, indent=2) print(f"Set {key} = {value}") elif key: print(f"{key} = {cfg.get(key, 'not set')}") else: print("Current configuration:") print(json.dumps(cfg, indent=2)) PYEOF ;; history) python3 << 'PYEOF' import os, json, sys data_file = os.environ.get("DATA_FILE", os.path.expanduser("~/.compound/data.jsonl")) config_file = os.environ.get("CONFIG_FILE", os.path.expanduser("~/.compound/config.json")) limit = int(os.environ.get("LIMIT", "20")) sort_by = os.environ.get("SORT", "date") try: with open(config_file) as f: cfg = json.load(f) symbol = cfg.get("currency_symbol", "$") except: symbol = "$" records = [] try: with open(data_file) as f: for line in f: line = line.strip() if line: try: records.append(json.loads(line)) except: pass except FileNotFoundError: pass if not records: print("No calculation history found.") sys.exit(0) if sort_by == "principal": records.sort(key=lambda x: x.get("params", {}).get("principal", 0), reverse=True) elif sort_by == "rate": records.sort(key=lambda x: x.get("params", {}).get("rate", 0), reverse=True) elif sort_by == "total": records.sort(key=lambda x: x.get("result", {}).get("final_amount", 0), reverse=True) else: records.sort(key=lambda x: x.get("timestamp", ""), reverse=True) records = records[:limit] print(f"{'ID':<14} {'Date':<20} {'Type':<10} {'Principal':>12} {'Rate':>7} {'Result':>14}") print("-" * 80) for r in records: ts = r.get("timestamp", "")[:19] typ = r.get("type", "?") p = r.get("params", {}) res = r.get("result", {}) principal_val = p.get("principal", 0) rate_val = p.get("rate", p.get("rates", "?")) final = res.get("final_amount", res.get("required_rate", res.get("years", "?"))) rate_str = f"{rate_val:.1f}%" if isinstance(rate_val, (int, float)) else str(rate_val)[:6] final_str = f"{symbol}{final:,.0f}" if isinstance(final, (int, float)) and final > 100 else str(final) print(f"{r.get('id',''):<14} {ts:<20} {typ:<10} {symbol}{principal_val:>11,.0f} {rate_str:>7} {final_str:>14}") print(f"\nShowing {len(records)} of total records") PYEOF ;; help) cat << 'HELPEOF' Compound — Compound Interest Calculator v1.0.0 Usage: bash scripts/script.sh <command> Commands: calculate Calculate compound interest compare Compare multiple interest rates schedule Generate detailed growth schedule table Year-by-year summary table rate Calculate required rate for a goal goal Calculate time to reach a savings goal chart ASCII chart of investment growth export Export calculation history config View/update configuration history View past calculations help Show this help message version Show version Environment Variables: PRINCIPAL Initial investment amount RATE Annual interest rate (%) YEARS Number of years FREQUENCY daily, monthly, quarterly, annually CONTRIBUTION Regular contribution amount TARGET Goal amount (for rate/goal commands) Examples: PRINCIPAL=10000 RATE=7.5 YEARS=20 bash scripts/script.sh calculate PRINCIPAL=10000 RATES="3,5,7,10" YEARS=20 bash scripts/script.sh compare PRINCIPAL=5000 TARGET=100000 RATE=8 bash scripts/script.sh goal Powered by BytesAgain | bytesagain.com | [email protected] HELPEOF ;; version) echo "compound vVERSION" ;; *) echo "Unknown command: $COMMAND" echo "Run 'bash scripts/script.sh help' for usage information" exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Base64 concepts, best practices, and implementation patterns.
--- name: "base64" version: "2.0.3" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Base64 concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [base64, reference] category: "devtools" --- # Base64 Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Base64 concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # base64 — Base64 reference tool. Use when working with base64 in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.2" show_help() { cat << 'HELPEOF' base64 v$VERSION — Base64 Reference Tool Usage: base64 <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Base64 — Overview ## What is Base64? Base64 (base64) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with base64. ## Key Concepts - Core base64 principles and fundamentals - How base64 fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Base64 Matters Understanding base64 is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic base64 concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Base64 — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the base64 package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Base64 — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for base64 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Base64 — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Base64 — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Base64 — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Base64 — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Base64 — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "base64 v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: base64 help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Md Convert concepts, best practices, and implementation patterns.
--- name: "md-convert" version: "2.0.3" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Md Convert concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [md,convert, reference] category: "devtools" --- # Md Convert Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Md Convert concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # md-convert — Md Convert reference tool. Use when working with md convert in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.2" show_help() { cat << 'HELPEOF' md-convert v$VERSION — Md Convert Reference Tool Usage: md-convert <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Md Convert — Overview ## What is Md Convert? Md Convert (md-convert) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with md convert. ## Key Concepts - Core md convert principles and fundamentals - How md convert fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Md Convert Matters Understanding md convert is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic md convert concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Md Convert — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the md convert package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Md Convert — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for md convert 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Md Convert — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Md Convert — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Md Convert — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Md Convert — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Md Convert — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "md-convert v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: md-convert help"; exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Markpad concepts, best practices, and implementation patterns.
--- name: "markpad" version: "2.0.3" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Markpad concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [markpad, reference] category: "devtools" --- # Markpad Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Markpad concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # markpad — Markpad reference tool. Use when working with markpad in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.2" show_help() { cat << 'HELPEOF' markpad v$VERSION — Markpad Reference Tool Usage: markpad <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Markpad — Overview ## What is Markpad? Markpad (markpad) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with markpad. ## Key Concepts - Core markpad principles and fundamentals - How markpad fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Markpad Matters Understanding markpad is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic markpad concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Markpad — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the markpad package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Markpad — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for markpad 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Markpad — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Markpad — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Markpad — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Markpad — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Markpad — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "markpad v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: markpad help"; exit 1 ;; esac
Generate CSS gradient code, preview gradient combinations, and build gradient palettes using bash and Python. Use when creating linear, radial, or conic grad...
--- version: "1.0.0" author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills description: "Generate CSS gradient code, preview gradient combinations, and build gradient palettes using bash and Python. Use when creating linear, radial, or conic gradients for web design." --- # Gradient — CSS Gradient Generator & Palette Builder Generate production-ready CSS gradient code for linear, radial, and conic gradients. Create gradient palettes, preview combinations, adjust angles and color stops, and export gradient collections. All gradient definitions are stored locally in JSONL format for reuse and sharing. ## Prerequisites - Python 3.6+ - Bash 4+ ## Data Storage All gradient records and palettes are stored in `~/.gradient/data.jsonl`. Each record is a JSON object with fields including `id`, `name`, `type` (linear, radial, conic), `css`, `stops`, `angle`, `created_at`, and additional metadata. ## Commands Run via: `bash scripts/script.sh <command> [options]` | Command | Description | |---|---| | `create` | Create a new gradient with type, colors, angle, and optional name | | `list` | List all saved gradients with names, types, and CSS preview | | `get` | Get full details and CSS code for a specific gradient by ID or name | | `update` | Update an existing gradient's colors, angle, or name | | `delete` | Remove a gradient from the collection by ID | | `linear` | Shortcut to generate a linear gradient with angle and color stops | | `radial` | Shortcut to generate a radial gradient with shape, position, and stops | | `conic` | Shortcut to generate a conic gradient with start angle and stops | | `random` | Generate random gradients with optional constraints on hue or type | | `palette` | Generate a collection of related gradients from a base color | | `export` | Export gradients as CSS classes, Tailwind config, or SCSS variables | | `preview` | Generate an HTML preview page for one or all gradients | | `help` | Show usage information | | `version` | Print the tool version | ## Usage Examples ```bash # Create a simple linear gradient bash scripts/script.sh create --name sunset --type linear --angle 135 --stops "#ff6b6b,#feca57,#48dbfb" # Shortcut for linear gradient bash scripts/script.sh linear --angle 90 --stops "#667eea,#764ba2" # Create a radial gradient bash scripts/script.sh radial --shape circle --position center --stops "#00d2ff,#3a7bd5" # Create a conic gradient bash scripts/script.sh conic --from 0 --stops "#ff0000,#00ff00,#0000ff,#ff0000" # List all saved gradients bash scripts/script.sh list # Get details for a gradient bash scripts/script.sh get --id abc123 # Update a gradient bash scripts/script.sh update --id abc123 --angle 180 --stops "#e74c3c,#9b59b6" # Delete a gradient bash scripts/script.sh delete --id abc123 # Generate 5 random gradients bash scripts/script.sh random --count 5 # Generate gradients with warm hues only bash scripts/script.sh random --count 3 --hue 0-60 # Build a palette from a base color bash scripts/script.sh palette --color "#3498db" --count 5 # Export as CSS bash scripts/script.sh export --format css --output gradients.css # Export as Tailwind config bash scripts/script.sh export --format tailwind --output tailwind-gradients.js # Generate HTML preview bash scripts/script.sh preview --output preview.html ``` ## Output Format `create`, `linear`, `radial`, and `conic` output the CSS gradient string to stdout. `list` returns a formatted table. `get` returns full JSON metadata. `export` writes to the specified file format. `preview` generates a self-contained HTML file. ## Notes - Gradient types: `linear`, `radial`, `conic`. - Linear gradients support angles in degrees (0-360) or keywords (`to right`, `to bottom left`). - Radial gradients support shapes: `circle`, `ellipse`; positions: `center`, `top left`, etc. - Color stops accept hex (`#rrggbb`), `rgb()`, `hsl()`, or CSS named colors. - Each stop can include an optional position percentage: `#ff0000:30%`. - The `palette` command generates harmonious gradient variations from a single base color. - Export formats: `css` (classes), `tailwind` (JS config), `scss` (variables with mixins). - Preview HTML includes responsive cards showing each gradient with its CSS code. --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/script.sh #!/usr/bin/env bash # gradient/scripts/script.sh — CSS Gradient Generator & Palette Builder # Data: ~/.gradient/data.jsonl set -euo pipefail VERSION="1.0.0" DATA_DIR="$HOME/.gradient" DATA_FILE="$DATA_DIR/data.jsonl" mkdir -p "$DATA_DIR" touch "$DATA_FILE" CMD="-help" shift 2>/dev/null || true show_help() { cat << 'HELPEOF' Gradient — CSS Gradient Generator & Palette Builder v1.0.0 Usage: bash scripts/script.sh <command> [options] Commands: create Create a new gradient with type, colors, angle, and name list List all saved gradients get Get full details and CSS code for a gradient update Update an existing gradient delete Remove a gradient by ID linear Shortcut to generate a linear gradient radial Shortcut to generate a radial gradient conic Shortcut to generate a conic gradient random Generate random gradients palette Generate related gradients from a base color export Export gradients as CSS, Tailwind, or SCSS preview Generate an HTML preview page help Show this help message version Print the tool version HELPEOF } case "$CMD" in create|list|get|update|delete|linear|radial|conic|random|palette|export|preview) SKILL_CMD="$CMD" SKILL_ARGV="$(printf '%s\n' "$@")" python3 << 'PYEOF' import sys, json, os, uuid, datetime, colorsys, random as rng, re DATA_DIR = os.path.expanduser("~/.gradient") DATA_FILE = os.path.join(DATA_DIR, "data.jsonl") def load_records(): records = [] if os.path.exists(DATA_FILE): with open(DATA_FILE, "r") as f: for line in f: line = line.strip() if line: try: records.append(json.loads(line)) except json.JSONDecodeError: pass return records def save_records(records): with open(DATA_FILE, "w") as f: for r in records: f.write(json.dumps(r) + "\n") def append_record(record): with open(DATA_FILE, "a") as f: f.write(json.dumps(record) + "\n") def gen_id(): return uuid.uuid4().hex[:8] def now_iso(): return datetime.datetime.now().isoformat() def parse_args(args): parsed = {} i = 0 while i < len(args): if args[i].startswith("--"): key = args[i][2:] if i + 1 < len(args) and not args[i+1].startswith("--"): parsed[key] = args[i+1] i += 2 else: parsed[key] = True i += 1 else: i += 1 return parsed def hex_to_rgb(h): h = h.lstrip("#") if len(h) == 3: h = h[0]*2 + h[1]*2 + h[2]*2 return tuple(int(h[i:i+2], 16) for i in (0, 2, 4)) def rgb_to_hex(r, g, b): return "#{:02x}{:02x}{:02x}".format(int(r), int(g), int(b)) def rgb_to_hsl(r, g, b): r1, g1, b1 = r/255.0, g/255.0, b/255.0 h, l, s = colorsys.rgb_to_hls(r1, g1, b1) return h*360, s*100, l*100 def hsl_to_rgb(h, s, l): r, g, b = colorsys.hls_to_rgb(h/360.0, l/100.0, s/100.0) return round(r*255), round(g*255), round(b*255) def parse_stops(stops_str): """Parse stops like '#ff0000,#00ff00,#0000ff' or '#ff0000:0%,#00ff00:50%,#0000ff:100%'""" stops = [] parts = stops_str.split(",") for i, part in enumerate(parts): part = part.strip() if ":" in part and not part.startswith("#") or (part.count(":") > 0 and "%" in part): # format: color:position segments = part.rsplit(":", 1) color = segments[0].strip() position = segments[1].strip() stops.append({"color": color, "position": position}) else: # auto-distribute if len(parts) > 1: pct = round(i / (len(parts) - 1) * 100) else: pct = 0 stops.append({"color": part, "position": f"{pct}%"}) return stops def build_css_linear(angle, stops): stop_strs = [f"{s['color']} {s['position']}" for s in stops] return f"linear-gradient({angle}deg, {', '.join(stop_strs)})" def build_css_radial(shape, position, stops): stop_strs = [f"{s['color']} {s['position']}" for s in stops] return f"radial-gradient({shape} at {position}, {', '.join(stop_strs)})" def build_css_conic(from_angle, stops): stop_strs = [f"{s['color']} {s['position']}" for s in stops] return f"conic-gradient(from {from_angle}deg, {', '.join(stop_strs)})" def cmd_create(args): opts = parse_args(args) name = opts.get("name", f"gradient-{gen_id()[:4]}") grad_type = opts.get("type", "linear") angle = int(opts.get("angle", "135")) stops_str = opts.get("stops", "#667eea,#764ba2") shape = opts.get("shape", "circle") position = opts.get("position", "center") from_angle = int(opts.get("from", "0")) stops = parse_stops(stops_str) if grad_type == "linear": css = build_css_linear(angle, stops) elif grad_type == "radial": css = build_css_radial(shape, position, stops) elif grad_type == "conic": css = build_css_conic(from_angle, stops) else: print(json.dumps({"error": f"Invalid type: {grad_type}"})) sys.exit(1) record = { "id": gen_id(), "name": name, "type": grad_type, "angle": angle, "stops": stops_str, "css": css, "created_at": now_iso() } append_record(record) print(css) print(json.dumps({"saved": record["id"], "name": name}, indent=2), file=sys.stderr) def cmd_list(args): records = load_records() if not records: print("No saved gradients.") return print(f"{'ID':<10} {'Name':<20} {'Type':<8} {'CSS (truncated)':<50}") print("-" * 88) for r in records: css_short = r.get("css", "")[:48] print(f"{r.get('id','?'):<10} {r.get('name','?'):<20} {r.get('type','?'):<8} {css_short:<50}") def cmd_get(args): opts = parse_args(args) gid = opts.get("id", opts.get("name", "")) records = load_records() for r in records: if r.get("id") == gid or r.get("name") == gid: print(json.dumps(r, indent=2)) return print(json.dumps({"error": f"Gradient '{gid}' not found"})) sys.exit(1) def cmd_update(args): opts = parse_args(args) gid = opts.get("id", "") if not gid: print(json.dumps({"error": "Please provide --id"})) sys.exit(1) records = load_records() found = False for r in records: if r.get("id") == gid: found = True if "name" in opts: r["name"] = opts["name"] if "angle" in opts: r["angle"] = int(opts["angle"]) if "stops" in opts: r["stops"] = opts["stops"] stops = parse_stops(opts["stops"]) grad_type = r.get("type", "linear") if grad_type == "linear": r["css"] = build_css_linear(r.get("angle", 135), stops) elif grad_type == "radial": r["css"] = build_css_radial(opts.get("shape", "circle"), opts.get("position", "center"), stops) elif grad_type == "conic": r["css"] = build_css_conic(r.get("angle", 0), stops) r["updated_at"] = now_iso() print(json.dumps(r, indent=2)) break if not found: print(json.dumps({"error": f"Gradient '{gid}' not found"})) sys.exit(1) save_records(records) def cmd_delete(args): opts = parse_args(args) gid = opts.get("id", "") if not gid: print(json.dumps({"error": "Please provide --id"})) sys.exit(1) records = load_records() new_records = [r for r in records if r.get("id") != gid] if len(new_records) == len(records): print(json.dumps({"error": f"Gradient '{gid}' not found"})) sys.exit(1) save_records(new_records) print(json.dumps({"deleted": True, "id": gid})) def cmd_linear(args): opts = parse_args(args) angle = int(opts.get("angle", "90")) stops_str = opts.get("stops", "#667eea,#764ba2") name = opts.get("name", f"linear-{gen_id()[:4]}") stops = parse_stops(stops_str) css = build_css_linear(angle, stops) record = {"id": gen_id(), "name": name, "type": "linear", "angle": angle, "stops": stops_str, "css": css, "created_at": now_iso()} append_record(record) print(css) def cmd_radial(args): opts = parse_args(args) shape = opts.get("shape", "circle") position = opts.get("position", "center") stops_str = opts.get("stops", "#00d2ff,#3a7bd5") name = opts.get("name", f"radial-{gen_id()[:4]}") stops = parse_stops(stops_str) css = build_css_radial(shape, position, stops) record = {"id": gen_id(), "name": name, "type": "radial", "shape": shape, "position": position, "stops": stops_str, "css": css, "created_at": now_iso()} append_record(record) print(css) def cmd_conic(args): opts = parse_args(args) from_angle = int(opts.get("from", "0")) stops_str = opts.get("stops", "#ff0000,#00ff00,#0000ff,#ff0000") name = opts.get("name", f"conic-{gen_id()[:4]}") stops = parse_stops(stops_str) css = build_css_conic(from_angle, stops) record = {"id": gen_id(), "name": name, "type": "conic", "from_angle": from_angle, "stops": stops_str, "css": css, "created_at": now_iso()} append_record(record) print(css) def cmd_random(args): opts = parse_args(args) count = int(opts.get("count", "1")) hue_range = opts.get("hue", "0-360") hue_parts = hue_range.split("-") hue_min, hue_max = int(hue_parts[0]), int(hue_parts[1]) grad_type = opts.get("type", "") gradients = [] for _ in range(count): h1 = rng.uniform(hue_min, hue_max) h2 = (h1 + rng.uniform(30, 180)) % 360 s1, s2 = rng.uniform(50, 100), rng.uniform(50, 100) l1, l2 = rng.uniform(30, 70), rng.uniform(30, 70) c1 = rgb_to_hex(*hsl_to_rgb(h1, s1, l1)) c2 = rgb_to_hex(*hsl_to_rgb(h2, s2, l2)) angle = rng.choice([0, 45, 90, 135, 180, 225, 270, 315]) gtype = grad_type if grad_type else rng.choice(["linear", "linear", "linear", "radial"]) stops = parse_stops(f"{c1},{c2}") if gtype == "linear": css = build_css_linear(angle, stops) elif gtype == "radial": css = build_css_radial("circle", "center", stops) else: css = build_css_linear(angle, stops) name = f"random-{gen_id()[:4]}" record = {"id": gen_id(), "name": name, "type": gtype, "stops": f"{c1},{c2}", "css": css, "created_at": now_iso()} append_record(record) gradients.append({"name": name, "type": gtype, "css": css}) print(json.dumps({"gradients": gradients}, indent=2)) def cmd_palette(args): opts = parse_args(args) color = opts.get("color", "#3498db") count = int(opts.get("count", "5")) r, g, b = hex_to_rgb(color) h, s, l = rgb_to_hsl(r, g, b) gradients = [] for i in range(count): offset = (360 / count) * i h2 = (h + offset) % 360 h3 = (h2 + 40) % 360 c1 = rgb_to_hex(*hsl_to_rgb(h2, s, l)) c2 = rgb_to_hex(*hsl_to_rgb(h3, min(s + 10, 100), min(l + 15, 85))) angle = 135 stops = parse_stops(f"{c1},{c2}") css = build_css_linear(angle, stops) name = f"palette-{gen_id()[:4]}" record = {"id": gen_id(), "name": name, "type": "linear", "stops": f"{c1},{c2}", "css": css, "created_at": now_iso()} append_record(record) gradients.append({"name": name, "css": css}) print(json.dumps({"base": color, "gradients": gradients}, indent=2)) def cmd_export(args): opts = parse_args(args) fmt = opts.get("format", "css") output = opts.get("output", f"gradients.{fmt}") records = load_records() if fmt == "css": lines = ["/* Generated Gradient Classes */"] for r in records: safe = re.sub(r'[^a-zA-Z0-9-]', '-', r.get("name", r.get("id", ""))) lines.append(f".gradient-{safe} {{") lines.append(f" background: {r.get('css', '')};") lines.append("}") lines.append("") content = "\n".join(lines) elif fmt == "tailwind": obj = {} for r in records: safe = re.sub(r'[^a-zA-Z0-9_]', '_', r.get("name", r.get("id", ""))) obj[safe] = r.get("css", "") content = f"// Tailwind gradient config\nmodule.exports = {json.dumps(obj, indent=2)};" elif fmt == "scss": lines = ["// Generated Gradient SCSS Variables"] for r in records: safe = re.sub(r'[^a-zA-Z0-9-]', '-', r.get("name", r.get("id", ""))) lines.append(f"$gradient-{safe}: {r.get('css', '')};") lines.append(f"@mixin gradient-{safe}() {{ background: $gradient-{safe}; }}") lines.append("") content = "\n".join(lines) else: content = json.dumps(records, indent=2) with open(output, "w") as f: f.write(content) print(json.dumps({"exported": output, "format": fmt, "count": len(records)})) def cmd_preview(args): opts = parse_args(args) output = opts.get("output", "gradient_preview.html") records = load_records() cards = [] for r in records: css = r.get("css", "") name = r.get("name", r.get("id", "?")) cards.append(f'''<div class="card"> <div class="swatch" style="background:{css}"></div> <div class="info"><strong>{name}</strong><br><code>{css}</code></div> </div>''') html = f'''<!DOCTYPE html> <html><head><meta charset="utf-8"><title>Gradient Preview</title> <style> body {{ font-family: -apple-system, sans-serif; background: #111; color: #eee; padding: 2rem; }} h1 {{ text-align: center; }} .grid {{ display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }} .card {{ border-radius: 12px; overflow: hidden; background: #222; }} .swatch {{ height: 160px; }} .info {{ padding: 1rem; font-size: 0.85rem; }} code {{ color: #8be9fd; word-break: break-all; }} </style></head> <body> <h1>Gradient Preview ({len(records)} gradients)</h1> <div class="grid"> {"".join(cards)} </div> </body></html>''' with open(output, "w") as f: f.write(html) print(json.dumps({"preview": output, "count": len(records)})) # --- main dispatch --- import shlex _cmd = os.environ.get("SKILL_CMD", "") _argv_raw = os.environ.get("SKILL_ARGV", "") args = [_cmd] + [a for a in _argv_raw.split("\n") if a] if _cmd else [] cmd = args[0] if args else "help" rest = args[1:] dispatch = { "create": cmd_create, "list": cmd_list, "get": cmd_get, "update": cmd_update, "delete": cmd_delete, "linear": cmd_linear, "radial": cmd_radial, "conic": cmd_conic, "random": cmd_random, "palette": cmd_palette, "export": cmd_export, "preview": cmd_preview, } if cmd in dispatch: dispatch[cmd](rest) else: print(f"Unknown command: {cmd}") sys.exit(1) PYEOF ;; help) show_help ;; version) echo "gradient vVERSION" ;; *) echo "Error: Unknown command '$CMD'" >&2 echo "Run 'bash scripts/script.sh help' for usage." >&2 exit 1 ;; esac
Manage a local key-value cache store using bash and Python. Use when caching API responses, session data, or computed results with TTL support.
---
version: "1.0.0"
author: BytesAgain
homepage: https://bytesagain.com
source: https://github.com/bytesagain/ai-skills
description: "Manage a local key-value cache store using bash and Python. Use when caching API responses, session data, or computed results with TTL support."
---
# Cache — Local Key-Value Cache Manager
A lightweight, file-backed key-value cache with TTL (time-to-live) support, search, bulk import/export, and statistics. Ideal for caching API responses, computed results, or any ephemeral data that benefits from quick local retrieval.
## Prerequisites
- Python 3.6+
- Bash 4+
## Data Storage
Cache entries are stored in `~/.cache-tool/data.jsonl` (note: uses `cache-tool` to avoid conflicts with `~/.cache`). Each line is a JSON object with fields: `key`, `value`, `ttl`, `created_at`, `expires_at`, `tags`, etc.
Configuration lives in `~/.cache-tool/config.json`.
## Commands
Run via: `bash scripts/script.sh <command> [options]`
| Command | Description |
|---|---|
| `set` | Store a key-value pair with optional TTL and tags |
| `get` | Retrieve the value for a given key |
| `delete` | Remove a key from the cache |
| `list` | List all cache entries (with optional tag filter) |
| `flush` | Delete all cache entries or those matching a pattern |
| `ttl` | Check or update the TTL for an existing key |
| `stats` | Show cache statistics (size, hit/miss ratio, memory) |
| `export` | Export the cache to a JSON file |
| `import` | Import cache entries from a JSON file |
| `search` | Search keys or values by substring or regex |
| `config` | View or update cache settings (default TTL, max size) |
| `help` | Show usage information |
| `version` | Print the tool version |
## Usage Examples
```bash
# Set a simple key-value pair
bash scripts/script.sh set --key api_response --value '{"status":"ok"}' --ttl 3600
# Set with tags
bash scripts/script.sh set --key user:42 --value '{"name":"Kelly"}' --tags user,profile
# Get a value
bash scripts/script.sh get --key api_response
# Delete a key
bash scripts/script.sh delete --key old_data
# List all entries
bash scripts/script.sh list
# List entries by tag
bash scripts/script.sh list --tag user
# Check remaining TTL
bash scripts/script.sh ttl --key api_response
# Update TTL
bash scripts/script.sh ttl --key api_response --set 7200
# Flush all entries
bash scripts/script.sh flush
# Flush by pattern
bash scripts/script.sh flush --pattern "user:*"
# Search by key pattern
bash scripts/script.sh search --query "api_" --field key
# Show cache stats
bash scripts/script.sh stats
# Export cache
bash scripts/script.sh export --output cache_backup.json
# Import cache
bash scripts/script.sh import --input cache_backup.json
# Configure defaults
bash scripts/script.sh config --set default_ttl=3600 --set max_entries=10000
```
## Notes
- Expired entries are lazily cleaned: they are skipped on `get` and purged during `flush` or `stats`.
- The `search` command supports both simple substring matching and Python regex patterns.
- `import` merges entries; existing keys are overwritten.
- `stats` reports total entries, expired count, active count, and approximate data size.
## Output Format
`get` returns the raw value to stdout. All other commands return JSON objects with status and metadata.
---
Powered by BytesAgain | bytesagain.com | [email protected]
FILE:scripts/script.sh
#!/usr/bin/env bash
# cache/scripts/script.sh — Local Key-Value Cache Manager
# Powered by BytesAgain | bytesagain.com | [email protected]
set -euo pipefail
VERSION="1.0.0"
DATA_DIR="$HOME/.cache-tool"
DATA_FILE="$DATA_DIR/data.jsonl"
CONFIG_FILE="$DATA_DIR/config.json"
mkdir -p "$DATA_DIR"
touch "$DATA_FILE"
if [ ! -f "$CONFIG_FILE" ]; then
echo '{"default_ttl":3600,"max_entries":10000}' > "$CONFIG_FILE"
fi
COMMAND="-help"
shift 2>/dev/null || true
export DATA_FILE CONFIG_FILE
export ARGS="$*"
show_help() {
cat << 'EOF'
Cache — Local Key-Value Cache Manager v1.0.0
Usage: bash script.sh <command> [options]
Commands:
set Store a key-value pair with optional TTL and tags
get Retrieve value for a key
delete Remove a key from cache
list List all cache entries
flush Delete all or matching entries
ttl Check or update TTL for a key
stats Show cache statistics
export Export cache to JSON file
import Import cache from JSON file
search Search keys/values by pattern
config View or update settings
help Show this help message
version Print version
Options:
--key Cache key
--value Cache value (string or JSON)
--ttl Time-to-live in seconds
--tags Comma-separated tags
--tag Filter by tag
--pattern Glob pattern for flush
--query Search query
--field Search field: key, value, or both
--output Output file path
--input Input file path
--set Config key=value
EOF
}
case "$COMMAND" in
set)
python3 << 'PYEOF'
import json, os, datetime
data_file = os.environ.get("DATA_FILE")
config_file = os.environ.get("CONFIG_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
key = params.get("key", "")
if not key:
print(json.dumps({"error": "Please provide --key"}, indent=2))
exit(1)
value = params.get("value", "")
tags_raw = params.get("tags", "")
tags = [t.strip() for t in tags_raw.split(",") if t.strip()] if tags_raw else []
with open(config_file, "r") as f:
config = json.load(f)
ttl = int(params.get("ttl", str(config.get("default_ttl", 3600))))
now = datetime.datetime.utcnow()
expires = now + datetime.timedelta(seconds=ttl)
# Remove existing key if present
records = []
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
if rec.get("key") != key:
records.append(rec)
# Add new entry
new_record = {
"key": key,
"value": value,
"ttl": ttl,
"tags": tags,
"created_at": now.isoformat() + "Z",
"expires_at": expires.isoformat() + "Z",
"access_count": 0,
"last_accessed": None
}
records.append(new_record)
with open(data_file, "w") as f:
for rec in records:
f.write(json.dumps(rec) + "\n")
print(json.dumps({"status": "set", "key": key, "ttl": ttl, "expires_at": expires.isoformat() + "Z"}, indent=2))
PYEOF
;;
get)
python3 << 'PYEOF'
import json, os, datetime
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
key = params.get("key", "")
if not key:
print(json.dumps({"error": "Please provide --key"}, indent=2))
exit(1)
now = datetime.datetime.utcnow()
records = []
found_value = None
found = False
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
if rec.get("key") == key:
exp = rec.get("expires_at", "")
try:
exp_dt = datetime.datetime.fromisoformat(exp.replace("Z", ""))
if now > exp_dt:
# Expired — skip
continue
except:
pass
found = True
rec["access_count"] = rec.get("access_count", 0) + 1
rec["last_accessed"] = now.isoformat() + "Z"
found_value = rec.get("value", "")
records.append(rec)
if found:
# Update access count
with open(data_file, "w") as f:
for rec in records:
f.write(json.dumps(rec) + "\n")
# Output raw value
print(found_value)
else:
print(json.dumps({"error": f"Key '{key}' not found or expired"}, indent=2))
exit(1)
PYEOF
;;
delete)
python3 << 'PYEOF'
import json, os
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
key = params.get("key", "")
if not key:
print(json.dumps({"error": "Please provide --key"}, indent=2))
exit(1)
records = []
deleted = False
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
if rec.get("key") == key:
deleted = True
else:
records.append(rec)
with open(data_file, "w") as f:
for rec in records:
f.write(json.dumps(rec) + "\n")
if deleted:
print(json.dumps({"status": "deleted", "key": key}, indent=2))
else:
print(json.dumps({"error": f"Key '{key}' not found"}, indent=2))
PYEOF
;;
list)
python3 << 'PYEOF'
import json, os, datetime
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
tag_filter = params.get("tag", "")
now = datetime.datetime.utcnow()
records = []
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
# Check expiry
exp = rec.get("expires_at", "")
try:
exp_dt = datetime.datetime.fromisoformat(exp.replace("Z", ""))
is_expired = now > exp_dt
except:
is_expired = False
status = "expired" if is_expired else "active"
if tag_filter and tag_filter not in rec.get("tags", []):
continue
records.append({
"key": rec.get("key"),
"status": status,
"ttl": rec.get("ttl"),
"tags": rec.get("tags", []),
"created_at": rec.get("created_at"),
"expires_at": rec.get("expires_at"),
"access_count": rec.get("access_count", 0)
})
if records:
print(json.dumps(records, indent=2))
else:
print(json.dumps({"message": "Cache is empty"}, indent=2))
PYEOF
;;
flush)
python3 << 'PYEOF'
import json, os, re, fnmatch
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
pattern = params.get("pattern", "")
if not pattern:
# Flush everything
with open(data_file, "w") as f:
pass
print(json.dumps({"status": "flushed", "message": "All entries deleted"}, indent=2))
else:
records = []
flushed = 0
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
if fnmatch.fnmatch(rec.get("key", ""), pattern):
flushed += 1
else:
records.append(rec)
with open(data_file, "w") as f:
for rec in records:
f.write(json.dumps(rec) + "\n")
print(json.dumps({"status": "flushed", "pattern": pattern, "deleted_count": flushed}, indent=2))
PYEOF
;;
ttl)
python3 << 'PYEOF'
import json, os, datetime
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
key = params.get("key", "")
new_ttl = params.get("set", "")
if not key:
print(json.dumps({"error": "Please provide --key"}, indent=2))
exit(1)
now = datetime.datetime.utcnow()
records = []
found = False
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
if rec.get("key") == key:
found = True
if new_ttl:
new_ttl_int = int(new_ttl)
rec["ttl"] = new_ttl_int
rec["expires_at"] = (now + datetime.timedelta(seconds=new_ttl_int)).isoformat() + "Z"
print(json.dumps({"status": "updated", "key": key, "new_ttl": new_ttl_int, "expires_at": rec["expires_at"]}, indent=2))
else:
exp = rec.get("expires_at", "")
try:
exp_dt = datetime.datetime.fromisoformat(exp.replace("Z", ""))
remaining = max(0, int((exp_dt - now).total_seconds()))
except:
remaining = -1
print(json.dumps({"key": key, "ttl_total": rec.get("ttl"), "ttl_remaining": remaining}, indent=2))
records.append(rec)
if not found:
print(json.dumps({"error": f"Key '{key}' not found"}, indent=2))
exit(1)
if new_ttl:
with open(data_file, "w") as f:
for rec in records:
f.write(json.dumps(rec) + "\n")
PYEOF
;;
stats)
python3 << 'PYEOF'
import json, os, datetime
data_file = os.environ.get("DATA_FILE")
now = datetime.datetime.utcnow()
total = 0
active = 0
expired = 0
total_access = 0
total_bytes = 0
tags_set = set()
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
total += 1
total_access += rec.get("access_count", 0)
total_bytes += len(json.dumps(rec))
for t in rec.get("tags", []):
tags_set.add(t)
exp = rec.get("expires_at", "")
try:
exp_dt = datetime.datetime.fromisoformat(exp.replace("Z", ""))
if now > exp_dt:
expired += 1
else:
active += 1
except:
active += 1
print(json.dumps({
"total_entries": total,
"active": active,
"expired": expired,
"total_accesses": total_access,
"data_size_bytes": total_bytes,
"data_size_kb": round(total_bytes / 1024, 2),
"unique_tags": sorted(list(tags_set))
}, indent=2))
PYEOF
;;
export)
python3 << 'PYEOF'
import json, os
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
output = params.get("output", "")
records = []
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
records.append(json.loads(line))
if output:
with open(output, "w") as f:
json.dump(records, f, indent=2)
print(json.dumps({"status": "exported", "file": output, "count": len(records)}, indent=2))
else:
print(json.dumps(records, indent=2))
PYEOF
;;
import)
python3 << 'PYEOF'
import json, os
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
input_file = params.get("input", "")
if not input_file:
print(json.dumps({"error": "Please provide --input"}, indent=2))
exit(1)
if not os.path.exists(input_file):
print(json.dumps({"error": f"File not found: {input_file}"}, indent=2))
exit(1)
with open(input_file, "r") as f:
import_data = json.load(f)
if not isinstance(import_data, list):
import_data = [import_data]
# Load existing and merge
existing = {}
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
existing[rec.get("key")] = rec
imported = 0
updated = 0
for rec in import_data:
key = rec.get("key", "")
if not key:
continue
if key in existing:
updated += 1
else:
imported += 1
existing[key] = rec
with open(data_file, "w") as f:
for rec in existing.values():
f.write(json.dumps(rec) + "\n")
print(json.dumps({"status": "imported", "new": imported, "updated": updated, "total": len(existing)}, indent=2))
PYEOF
;;
search)
python3 << 'PYEOF'
import json, os, re
data_file = os.environ.get("DATA_FILE")
raw_args = os.environ.get("ARGS", "")
params = {}
tokens = raw_args.split()
i = 0
while i < len(tokens):
if tokens[i].startswith("--") and i + 1 < len(tokens):
params[tokens[i][2:]] = tokens[i + 1]
i += 2
else:
i += 1
query = params.get("query", "")
field = params.get("field", "both")
if not query:
print(json.dumps({"error": "Please provide --query"}, indent=2))
exit(1)
results = []
try:
pattern = re.compile(query, re.IGNORECASE)
except:
pattern = None
with open(data_file, "r") as f:
for line in f:
line = line.strip()
if not line:
continue
rec = json.loads(line)
key = rec.get("key", "")
value = str(rec.get("value", ""))
match = False
if field in ("key", "both"):
if pattern:
match = match or bool(pattern.search(key))
else:
match = match or query.lower() in key.lower()
if field in ("value", "both"):
if pattern:
match = match or bool(pattern.search(value))
else:
match = match or query.lower() in value.lower()
if match:
results.append({
"key": key,
"value": rec.get("value"),
"tags": rec.get("tags", []),
"created_at": rec.get("created_at")
})
print(json.dumps({"query": query, "field": field, "count": len(results), "results": results}, indent=2))
PYEOF
;;
config)
python3 << 'PYEOF'
import json, os
config_file = os.environ.get("CONFIG_FILE")
raw_args = os.environ.get("ARGS", "")
with open(config_file, "r") as f:
config = json.load(f)
if "--set" in raw_args:
tokens = raw_args.split()
for i, t in enumerate(tokens):
if t == "--set" and i + 1 < len(tokens):
kv = tokens[i + 1]
if "=" in kv:
k, v = kv.split("=", 1)
try:
v = int(v)
except:
pass
config[k] = v
with open(config_file, "w") as f:
json.dump(config, f, indent=2)
print(json.dumps({"status": "updated", "config": config}, indent=2))
else:
print(json.dumps(config, indent=2))
PYEOF
;;
help)
show_help
;;
version)
echo "{\"tool\": \"cache\", \"version\": \"$VERSION\"}"
;;
*)
echo "{\"error\": \"Unknown command: $COMMAND. Run 'help' for usage.\"}"
exit 1
;;
esac
Sort and organize files into folders by type, date, or rules. Use when decluttering dirs, checking structure, running cleanup, generating reports.
--- version: "2.0.0" name: tidyfiles description: "Sort and organize files into folders by type, date, or rules. Use when decluttering dirs, checking structure, running cleanup, generating reports." --- # Tidyfiles A versatile utility toolkit for recording, tracking, and managing file organization tasks from the command line. Each command logs timestamped entries to its own dedicated log file, with built-in statistics, multi-format export, search, and health-check capabilities. ## Why Tidyfiles? - Works entirely offline — your data stays on your machine - Each command type maintains its own log file for clean data separation - Built-in multi-format export (JSON, CSV, plain text) - Full activity history with timestamped audit trail - Search across all log files instantly - Summary statistics with entry counts and disk usage - Zero external dependencies — pure bash ## Commands ### Core Operations | Command | Description | |---------|-------------| | `tidyfiles run <input>` | Record a run entry (no args: show recent entries) | | `tidyfiles check <input>` | Record a check entry (no args: show recent entries) | | `tidyfiles convert <input>` | Record a convert entry (no args: show recent entries) | | `tidyfiles analyze <input>` | Record an analyze entry (no args: show recent entries) | | `tidyfiles generate <input>` | Record a generate entry (no args: show recent entries) | | `tidyfiles preview <input>` | Record a preview entry (no args: show recent entries) | | `tidyfiles batch <input>` | Record a batch entry (no args: show recent entries) | | `tidyfiles compare <input>` | Record a compare entry (no args: show recent entries) | | `tidyfiles export <input>` | Record an export entry (no args: show recent entries) | | `tidyfiles config <input>` | Record a config entry (no args: show recent entries) | | `tidyfiles status <input>` | Record a status entry (no args: show recent entries) | | `tidyfiles report <input>` | Record a report entry (no args: show recent entries) | ### Utility Commands | Command | Description | |---------|-------------| | `tidyfiles stats` | Show summary statistics (entry counts per type, total, disk usage) | | `tidyfiles export <fmt>` | Export all data in json, csv, or txt format | | `tidyfiles search <term>` | Search across all log files (case-insensitive) | | `tidyfiles recent` | Show the 20 most recent activity log entries | | `tidyfiles status` | Health check (version, entries, disk, last activity) | | `tidyfiles help` | Display all available commands | | `tidyfiles version` | Print version string | Each core command works in two modes: - **With arguments**: Saves a timestamped entry to `<command>.log` and logs to `history.log` - **Without arguments**: Displays the 20 most recent entries from that command's log ## Data Storage All data is stored locally in `~/.local/share/tidyfiles/`. The directory contains: - **`run.log`**, **`check.log`**, **`convert.log`**, **`analyze.log`**, etc. — One log file per command type, storing `YYYY-MM-DD HH:MM|input` entries - **`history.log`** — Unified activity log with timestamped records of every command executed - **`export.json`** / **`export.csv`** / **`export.txt`** — Generated export files ## Requirements - **Bash** 4.0+ with `set -euo pipefail` strict mode - Standard Unix utilities: `grep`, `cat`, `tail`, `wc`, `du`, `date`, `sed` - No external dependencies or network access required ## When to Use 1. **Tracking file organization tasks** — Use `tidyfiles run "sorted ~/Downloads by file type"` to log cleanup activities with timestamps 2. **Checking directory structure** — Record structure checks with `tidyfiles check "~/projects: 45 dirs, 230 files, no empty dirs"` 3. **Analyzing disk usage patterns** — Log analysis results with `tidyfiles analyze "Documents folder: 12GB, 40% PDFs"` and review with `tidyfiles search "Documents"` 4. **Batch file operations** — Track batch processing with `tidyfiles batch "renamed 150 photos with date prefix"` and review past batches 5. **Generating cleanup reports** — Use `tidyfiles report "weekly cleanup: freed 3.2GB"` then `tidyfiles export csv` for spreadsheet analysis ## Examples ```bash # Record file organization activities tidyfiles run "organized Downloads into subfolders" tidyfiles check "verified backup integrity: 100% match" tidyfiles analyze "home directory: 85GB used, 15GB free" # Track conversions and batch operations tidyfiles convert "batch converted 200 PNGs to WebP" tidyfiles batch "moved archived projects to cold storage" tidyfiles generate "created folder structure for new project" # Preview and compare tidyfiles preview "dry-run sort of ~/Desktop: 45 files to move" tidyfiles compare "before/after cleanup: 12GB freed" # Search, review, and export tidyfiles search "backup" tidyfiles recent tidyfiles stats tidyfiles export json tidyfiles export csv # Configuration and reporting tidyfiles config "default sort: by extension" tidyfiles report "monthly cleanup summary: 25GB reclaimed" tidyfiles status ``` ## Configuration The data directory defaults to `~/.local/share/tidyfiles/`. All log files are plain text with pipe-delimited fields (`timestamp|value`), making them easy to parse with standard Unix tools or import into spreadsheets. --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/script.sh #!/usr/bin/env bash # Tidyfiles — utility tool # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail DATA_DIR="HOME/.local/share/tidyfiles" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } _version() { echo "tidyfiles v2.0.0"; } _help() { echo "Tidyfiles v2.0.0 — utility toolkit" echo "" echo "Usage: tidyfiles <command> [args]" echo "" echo "Commands:" echo " run Run" echo " check Check" echo " convert Convert" echo " analyze Analyze" echo " generate Generate" echo " preview Preview" echo " batch Batch" echo " compare Compare" echo " export Export" echo " config Config" echo " status Status" 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 "=== Tidyfiles 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="-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 "=== Tidyfiles 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 "=== Tidyfiles 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="?Usage: tidyfiles 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 "-help" in run) shift if [ $# -eq 0 ]; then echo "Recent run entries:" tail -20 "$DATA_DIR/run.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles run <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/run.log" local total=$(wc -l < "$DATA_DIR/run.log") echo " [Tidyfiles] run: $input" echo " Saved. Total run entries: $total" _log "run" "$input" fi ;; check) shift if [ $# -eq 0 ]; then echo "Recent check entries:" tail -20 "$DATA_DIR/check.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles 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 " [Tidyfiles] check: $input" echo " Saved. Total check entries: $total" _log "check" "$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: tidyfiles 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 " [Tidyfiles] convert: $input" echo " Saved. Total convert entries: $total" _log "convert" "$input" fi ;; analyze) shift if [ $# -eq 0 ]; then echo "Recent analyze entries:" tail -20 "$DATA_DIR/analyze.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles analyze <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/analyze.log" local total=$(wc -l < "$DATA_DIR/analyze.log") echo " [Tidyfiles] analyze: $input" echo " Saved. Total analyze entries: $total" _log "analyze" "$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: tidyfiles 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 " [Tidyfiles] generate: $input" echo " Saved. Total generate entries: $total" _log "generate" "$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: tidyfiles 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 " [Tidyfiles] preview: $input" echo " Saved. Total preview entries: $total" _log "preview" "$input" fi ;; batch) shift if [ $# -eq 0 ]; then echo "Recent batch entries:" tail -20 "$DATA_DIR/batch.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles batch <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/batch.log" local total=$(wc -l < "$DATA_DIR/batch.log") echo " [Tidyfiles] batch: $input" echo " Saved. Total batch entries: $total" _log "batch" "$input" fi ;; compare) shift if [ $# -eq 0 ]; then echo "Recent compare entries:" tail -20 "$DATA_DIR/compare.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles compare <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/compare.log" local total=$(wc -l < "$DATA_DIR/compare.log") echo " [Tidyfiles] compare: $input" echo " Saved. Total compare entries: $total" _log "compare" "$input" fi ;; export) shift if [ $# -eq 0 ]; then echo "Recent export entries:" tail -20 "$DATA_DIR/export.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles export <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/export.log" local total=$(wc -l < "$DATA_DIR/export.log") echo " [Tidyfiles] export: $input" echo " Saved. Total export entries: $total" _log "export" "$input" fi ;; config) shift if [ $# -eq 0 ]; then echo "Recent config entries:" tail -20 "$DATA_DIR/config.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles config <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/config.log" local total=$(wc -l < "$DATA_DIR/config.log") echo " [Tidyfiles] config: $input" echo " Saved. Total config entries: $total" _log "config" "$input" fi ;; status) shift if [ $# -eq 0 ]; then echo "Recent status entries:" tail -20 "$DATA_DIR/status.log" 2>/dev/null || echo " No entries yet. Use: tidyfiles status <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/status.log" local total=$(wc -l < "$DATA_DIR/status.log") echo " [Tidyfiles] status: $input" echo " Saved. Total status entries: $total" _log "status" "$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: tidyfiles 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 " [Tidyfiles] 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 'tidyfiles help'" exit 1 ;; esac
Define goals, break them into milestones, and track progress step by step. Use when setting life goals, planning milestones, tracking long-term progress.
--- 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 | [email protected] FILE:scripts/script.sh #!/usr/bin/env bash # Lifegoals — devtools tool # Powered by BytesAgain | bytesagain.com | [email protected] 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="-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="?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 "-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
Save and organize reusable text snippets for quick retrieval. Use when storing code fragments, saving command templates, or building snippet libraries.
--- name: ClipBox description: "Save and organize reusable text snippets for quick retrieval. Use when storing code fragments, saving command templates, or building snippet libraries." version: "2.0.0" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["clipboard","snippets","text","paste","templates","productivity","developer"] categories: ["Productivity", "Developer Tools", "Utility"] --- # ClipBox Developer toolkit for logging, tracking, and exporting entries across multiple categories. Each command records timestamped entries to its own log file. Call without arguments to view recent entries; call with arguments to record a new entry. ## Commands | Command | What it does | |---------|-------------| | `clipbox check <input>` | Record a check entry (no args = show recent) | | `clipbox validate <input>` | Record a validate entry (no args = show recent) | | `clipbox generate <input>` | Record a generate entry (no args = show recent) | | `clipbox format <input>` | Record a format entry (no args = show recent) | | `clipbox lint <input>` | Record a lint entry (no args = show recent) | | `clipbox explain <input>` | Record an explain entry (no args = show recent) | | `clipbox convert <input>` | Record a convert entry (no args = show recent) | | `clipbox template <input>` | Record a template entry (no args = show recent) | | `clipbox diff <input>` | Record a diff entry (no args = show recent) | | `clipbox preview <input>` | Record a preview entry (no args = show recent) | | `clipbox fix <input>` | Record a fix entry (no args = show recent) | | `clipbox report <input>` | Record a report entry (no args = show recent) | | `clipbox stats` | Show summary statistics across all log files | | `clipbox export <fmt>` | Export all data to json, csv, or txt format | | `clipbox search <term>` | Search all log entries for a keyword | | `clipbox recent` | Show the 20 most recent history entries | | `clipbox status` | Health check — version, entry count, disk usage, last activity | | `clipbox help` | Show help message | | `clipbox version` | Show version (v2.0.0) | ## Data Storage All data is stored locally in `~/.local/share/clipbox/`. Each command writes to its own `.log` file (e.g., `check.log`, `lint.log`). A unified `history.log` tracks all activity with timestamps. ## Requirements - Bash 4+ - Standard Unix utilities (`wc`, `du`, `tail`, `grep`, `date`, `sed`) ## When to Use - Logging code checks, lint results, or validation outcomes with timestamps - Tracking format conversions, diffs, and template usage over time - Searching historical entries by keyword across all categories - Exporting accumulated data to JSON, CSV, or plain text for review - Getting a quick status overview of entry counts and disk usage ## Examples ```bash # Record a lint finding clipbox lint "unused variable 'count' in main.py line 42" # Record a template usage clipbox template "created new React component from base template" # Search all logs for "main.py" clipbox search main.py # Export everything to JSON clipbox export json # View overall stats clipbox stats # Check health status clipbox status ``` --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/script.sh #!/usr/bin/env bash # Clipbox — devtools tool # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail DATA_DIR="HOME/.local/share/clipbox" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } _version() { echo "clipbox v2.0.0"; } _help() { echo "Clipbox v2.0.0 — devtools toolkit" echo "" echo "Usage: clipbox <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 "=== Clipbox 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="-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 "=== Clipbox 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 "=== Clipbox 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="?Usage: clipbox 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 "-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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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: clipbox 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 " [Clipbox] 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 'clipbox help'" exit 1 ;; esac
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Tidyup concepts, best practices, and implementation patterns.
--- name: "tidyup" version: "2.0.2" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Tidyup concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [tidyup, reference] category: "devtools" --- # Tidyup Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Tidyup concepts, best practices, and implementation patterns. No API keys or credentials required. ## Commands | Command | Description | |---------|-------------| | `intro` | intro reference | | `quickstart` | quickstart reference | | `patterns` | patterns reference | | `debugging` | debugging reference | | `performance` | performance reference | | `security` | security reference | | `migration` | migration reference | | `cheatsheet` | cheatsheet reference | ## Output Format All commands output plain-text reference documentation via heredoc. No external API calls, no credentials needed, no network access. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # tidyup — Tidyup reference tool. Use when working with tidyup in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.1" show_help() { cat << 'HELPEOF' tidyup v$VERSION — Tidyup Reference Tool Usage: tidyup <command> Commands: intro Overview and core concepts quickstart Getting started guide patterns Common patterns and best practices debugging Debugging and troubleshooting performance Performance optimization tips security Security considerations migration Migration and upgrade guide cheatsheet Quick reference cheat sheet help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Tidyup — Overview ## What is Tidyup? Tidyup (tidyup) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with tidyup. ## Key Concepts - Core tidyup principles and fundamentals - How tidyup fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Tidyup Matters Understanding tidyup is critical for: - Improving efficiency in devtools workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic tidyup concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Tidyup — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the tidyup package 2. Install dependencies 3. Configure initial settings 4. Verify installation ## First Steps 1. Run the hello-world example 2. Review the default configuration 3. Try a simple real-world task 4. Explore available commands and options ## Next Steps - Read the full documentation - Join the community forum - Try advanced features - Set up automated workflows EOF } cmd_patterns() { cat << 'EOF' # Tidyup — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for tidyup 2. **Scalable Pattern**: For high-volume or distributed scenarios 3. **Resilient Pattern**: For fault-tolerant implementations ## Best Practices - Follow the principle of least privilege - Use version control for all configurations - Implement comprehensive logging - Test changes in staging before production - Document all custom configurations ## Anti-Patterns to Avoid - Hardcoding credentials or configuration - Skipping validation and error handling - Ignoring monitoring and alerting - Making changes without documentation - Over-engineering simple solutions EOF } cmd_debugging() { cat << 'EOF' # Tidyup — Debugging Guide ## Common Errors 1. **Connection refused**: Check service status and network 2. **Permission denied**: Verify credentials and access rights 3. **Timeout**: Check network, increase limits, optimize queries 4. **Invalid input**: Validate data format and encoding ## Debugging Tools - Built-in logging and diagnostics - Network analysis tools (tcpdump, wireshark) - System monitoring (top, htop, iostat) - Application-specific debug modes ## Debug Workflow 1. Reproduce the issue consistently 2. Check logs for error messages 3. Isolate the failing component 4. Test with minimal configuration 5. Apply fix and verify EOF } cmd_performance() { cat << 'EOF' # Tidyup — Performance Optimization ## Key Metrics - Response time / latency - Throughput / operations per second - Resource utilization (CPU, memory, I/O) - Error rate and retry frequency ## Optimization Strategies 1. **Caching**: Reduce redundant operations 2. **Batching**: Group small operations 3. **Indexing**: Speed up data lookups 4. **Compression**: Reduce data transfer size 5. **Parallel Processing**: Utilize multiple cores ## Monitoring - Set up baseline performance metrics - Configure alerts for anomalies - Track trends over time - Regular capacity planning reviews EOF } cmd_security() { cat << 'EOF' # Tidyup — Security Considerations ## Authentication & Authorization - Use strong, unique credentials - Implement role-based access control - Enable multi-factor authentication where possible - Regularly review and rotate credentials ## Data Protection - Encrypt data at rest and in transit - Implement proper backup procedures - Follow data retention policies - Sanitize inputs to prevent injection ## Network Security - Use firewalls and network segmentation - Monitor for suspicious activity - Keep all software patched and updated - Disable unnecessary services and ports EOF } cmd_migration() { cat << 'EOF' # Tidyup — Migration & Upgrade Guide ## Pre-Migration Checklist - [ ] Current system fully documented - [ ] Complete backup taken and verified - [ ] Target environment prepared - [ ] Rollback plan documented - [ ] Stakeholders notified ## Migration Steps 1. Prepare target environment 2. Export data from source 3. Transform data if needed 4. Import to target 5. Verify data integrity 6. Update configurations 7. Test all functionality 8. Switch traffic / go live ## Post-Migration - Monitor for errors and performance - Verify all integrations working - Update documentation - Decommission old system after confirmation EOF } cmd_cheatsheet() { cat << 'EOF' # Tidyup — Quick Reference ## Essential Commands | Command | Description | |---------|-------------| | help | Show available commands | | version | Display version info | | intro | Overview and fundamentals | | troubleshooting | Common problems and fixes | ## Common Workflows 1. **Setup**: install → configure → verify → test 2. **Daily**: check → monitor → report → review 3. **Issue**: diagnose → isolate → fix → verify → document ## Key Shortcuts - Use tab completion for commands - Check logs first when troubleshooting - Always backup before making changes - Document everything you change EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; quickstart) cmd_quickstart "$@" ;; patterns) cmd_patterns "$@" ;; debugging) cmd_debugging "$@" ;; performance) cmd_performance "$@" ;; security) cmd_security "$@" ;; migration) cmd_migration "$@" ;; cheatsheet) cmd_cheatsheet "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "tidyup v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: tidyup help"; exit 1 ;; esac