@clawhub-bytesagain-lab-4f4db08043
Build ETL pipelines with data ingestion, cleaning, and validation steps. Use when ingesting sources, transforming formats, validating data, or scheduling loads.
--- name: etl version: "2.0.0" author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills license: MIT-0 tags: [etl, tool, utility] description: "Build ETL pipelines with data ingestion, cleaning, and validation steps. Use when ingesting sources, transforming formats, validating data, or scheduling loads." --- # ETL Extract-Transform-Load data toolkit (v2.0.0). Record and manage data pipeline activities across the full ETL lifecycle — ingest, transform, query, filter, aggregate, visualize, export, sample, schema definition, validation, pipeline orchestration, and data profiling. Each command logs timestamped entries to its own log file, giving you a structured record of all data operations. ## Commands | Command | Description | |---------|-------------| | `etl ingest <input>` | Record a data ingestion event (source, format, row count, etc.). Without args, shows recent ingest entries. | | `etl transform <input>` | Log a transformation step (column rename, type cast, normalization, etc.). Without args, shows recent transforms. | | `etl query <input>` | Record a query operation or SQL statement. Without args, shows recent queries. | | `etl filter <input>` | Log a filtering rule or condition applied to data. Without args, shows recent filters. | | `etl aggregate <input>` | Record an aggregation step (GROUP BY, SUM, AVG, etc.). Without args, shows recent aggregations. | | `etl visualize <input>` | Log a visualization request or chart configuration. Without args, shows recent visualizations. | | `etl export <input>` | Record an export operation (destination, format, row count). Without args, shows recent exports. | | `etl sample <input>` | Log a data sampling step (sample size, method, seed). Without args, shows recent samples. | | `etl schema <input>` | Record a schema definition or schema change. Without args, shows recent schema entries. | | `etl validate <input>` | Log a data validation rule or result. Without args, shows recent validations. | | `etl pipeline <input>` | Record a pipeline configuration or execution step. Without args, shows recent pipeline entries. | | `etl profile <input>` | Log a data profiling result (null counts, distributions, anomalies). Without args, shows recent profiles. | | `etl stats` | Show summary statistics: entry counts per category, total entries, data size, and earliest record date. | | `etl export <fmt>` | Export all logged data to a file. Supported formats: `json`, `csv`, `txt`. (Note: this is a different code path from the `export` log command — it exports the tool's own data.) | | `etl search <term>` | Search across all log files for a keyword (case-insensitive). | | `etl recent` | Show the 20 most recent entries from the activity history log. | | `etl status` | Health check: version, data directory, total entries, disk usage, last activity. | | `etl help` | Show the built-in help with all available commands. | | `etl version` | Print the current version (v2.0.0). | ## Data Storage All data is stored as plain-text log files in `~/.local/share/etl/`: - **Per-command logs** — Each command (ingest, transform, query, etc.) writes to its own `.log` file (e.g., `ingest.log`, `transform.log`). - **History log** — Every operation is also appended to `history.log` with a timestamp and command name. - **Export files** — Generated in the same directory as `export.json`, `export.csv`, or `export.txt`. Entries are stored in `timestamp|value` format, making them easy to grep, parse, or pipe into downstream tools. ## Requirements - **Bash** 4.0+ (uses `set -euo pipefail`) - **coreutils** — `date`, `wc`, `du`, `head`, `tail`, `grep`, `basename`, `cut` - No external dependencies, API keys, or network access required - Works fully offline on any POSIX-compatible system ## When to Use 1. **Logging data pipeline steps** — Record each stage of your ETL process (ingest → transform → validate → export) with timestamps, creating a complete audit trail of data movements. 2. **Schema management and validation** — Use `schema` to document table structures and `validate` to log data quality rules and their pass/fail results. 3. **Data profiling and exploration** — Use `profile` to record column statistics, null rates, and distribution anomalies; use `sample` to log sampling parameters for reproducibility. 4. **Pipeline orchestration tracking** — Use `pipeline` to record multi-step workflow configurations, execution order, and dependencies between ETL stages. 5. **Cross-team data operations review** — Run `stats` for aggregate counts, `search` to find specific operations by keyword, and `export json` to share pipeline logs with team members or load into dashboards. ## Examples ```bash # Log a data ingestion from S3 etl ingest "s3://data-lake/raw/users_2024.csv — 1.2M rows, CSV format" # Record a transformation step etl transform "Normalize email to lowercase, cast created_at to UTC timestamp" # Log a validation rule etl validate "NOT NULL check on user_id: 0 violations out of 1,200,000 rows" # Record schema for a new table etl schema "users_dim: id INT PK, email VARCHAR(255), created_at TIMESTAMP, country CHAR(2)" # Define a pipeline etl pipeline "daily_user_load: ingest(s3) -> dedupe -> validate -> load(postgres)" # Search for anything related to 'users' etl search users # Export all ETL logs to CSV for analysis etl export csv # View summary statistics etl stats # Check system health etl status ``` ## Tips - Run any data command without arguments to see recent entries (e.g., `etl ingest` shows the last 20 ingest entries). - Use `etl recent` for a quick overview of all activity across all categories. - Combine with cron to auto-log pipeline runs: `0 2 * * * etl pipeline "nightly_load completed at $(date)"` - Back up your data by copying `~/.local/share/etl/` to your preferred backup location. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # Etl — data tool # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail DATA_DIR="HOME/.local/share/etl" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } _version() { echo "etl v2.0.0"; } _help() { echo "Etl v2.0.0 — data toolkit" echo "" echo "Usage: etl <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 " status Health check" echo " help Show this help" echo " version Show version" echo "" echo "Data: $DATA_DIR" } _stats() { echo "=== Etl 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)" echo " Since: $(head -1 "$DATA_DIR/history.log" 2>/dev/null | cut -d'|' -f1 || echo 'N/A')" } _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 "" >> "$out" echo "]" >> "$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 "=== Etl Export ===" > "$out" for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue echo "--- $(basename "$f" .log) ---" >> "$out" cat "$f" >> "$out" echo "" >> "$out" done ;; *) echo "Formats: json, csv, txt"; return 1 ;; esac echo "Exported to $out ($(wc -c < "$out") bytes)" } _status() { echo "=== Etl 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)" local last=$(tail -1 "$DATA_DIR/history.log" 2>/dev/null || echo "never") echo " Last activity: $last" echo " Status: OK" } _search() { local term="?Usage: etl search <term>" echo "Searching for: $term" local found=0 for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local matches=$(grep -i "$term" "$f" 2>/dev/null || true) if [ -n "$matches" ]; then echo " --- $(basename "$f" .log) ---" echo "$matches" | while read -r line; do echo " $line" found=$((found + 1)) done fi done [ $found -eq 0 ] && echo " No matches found." } _recent() { echo "=== Recent Activity ===" if [ -f "$DATA_DIR/history.log" ]; then tail -20 "$DATA_DIR/history.log" | while IFS='' read -r line; do echo " $line" done else echo " No activity yet." fi } # Main dispatch 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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: etl 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 " [Etl] 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 command: $1" echo "Run 'etl help' for available commands." exit 1 ;; esac
Generate study materials. Use when creating study plans, quizzes, flashcards, tracking progress, or scheduling review sessions.
--- name: education description: "Generate study materials. Use when creating study plans, quizzes, flashcards, tracking progress, or scheduling review sessions." version: "3.4.0" author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: - education - learning - study - quiz - flashcard - review --- # Education Skill Generate study plans, quizzes, flashcards, and review materials for any topic. Track progress and schedule sessions. ## Commands ### plan Generate a structured learning plan for a topic. ```bash bash scripts/script.sh plan <topic> [--weeks <num>] [--level beginner|intermediate|advanced] [--output json|text] ``` ### quiz Generate quiz questions on a topic. ```bash bash scripts/script.sh quiz <topic> [--count <num>] [--type mcq|truefalse|short] [--difficulty easy|medium|hard] ``` ### flashcard Generate flashcards for key concepts. ```bash bash scripts/script.sh flashcard <topic> [--count <num>] [--format plain|csv|json] ``` ### progress Track and display learning progress. ```bash bash scripts/script.sh progress [--topic <topic>] [--mark <milestone>] [--reset] ``` ### schedule Create a study schedule with time blocks. ```bash bash scripts/script.sh schedule <topic> [--hours-per-day <num>] [--days <num>] [--start <date>] ``` ### review Generate a review checklist from completed topics. ```bash bash scripts/script.sh review <topic> [--scope all|weak|recent] [--format checklist|summary] ``` ## Output All commands print to stdout. Use `--output json` (where supported) for machine-readable output. Progress data is stored in `~/.education/progress.json`. ## Requirements - bash 4+ - python3 (standard library only) ## Feedback Questions or suggestions? → [https://bytesagain.com/feedback/](https://bytesagain.com/feedback/) --- Powered by BytesAgain | bytesagain.com FILE:scripts/script.sh #!/usr/bin/env bash set -euo pipefail ############################################################################### # education/scripts/script.sh — Study plan generator, quiz maker, flashcards, # progress tracker, scheduler, and review list builder. ############################################################################### DATA_DIR="HOME/.education" PROGRESS_FILE="DATA_DIR/progress.json" ensure_data_dir() { mkdir -p "DATA_DIR" if [[ ! -f "PROGRESS_FILE" ]]; then echo '{}' > "PROGRESS_FILE" fi } # ─── plan ──────────────────────────────────────────────────────────────────── cmd_plan() { local topic="" weeks=4 level="beginner" output="text" while [[ $# -gt 0 ]]; do case "$1" in --weeks) weeks="$2"; shift 2 ;; --level) level="$2"; shift 2 ;; --output) output="$2"; shift 2 ;; -*) echo "Unknown flag: $1" >&2; return 1 ;; *) topic="$1"; shift ;; esac done if [[ -z "topic" ]]; then echo "Usage: script.sh plan <topic> [--weeks N] [--level beginner|intermediate|advanced] [--output json|text]" >&2 return 1 fi local hours_per_week case "level" in beginner) hours_per_week=5 ;; intermediate) hours_per_week=8 ;; advanced) hours_per_week=12 ;; *) echo "Invalid level: level" >&2; return 1 ;; esac if [[ "output" == "json" ]]; then echo "{" echo " \"topic\": \"topic\"," echo " \"level\": \"level\"," echo " \"weeks\": weeks," echo " \"hours_per_week\": hours_per_week," echo " \"total_hours\": $(( weeks * hours_per_week ))," echo " \"plan\": [" for (( w=1; w<=weeks; w++ )); do local comma="," [[ w -eq weeks ]] && comma="" echo " {\"week\": w, \"focus\": \"Week w — topic block w\", \"hours\": hours_per_week}comma" done echo " ]" echo "}" else echo "=== Study Plan: topic ===" echo "Level: level | Duration: weeks weeks | hours_per_weekh/week | Total: $(( weeks * hours_per_week ))h" echo "" for (( w=1; w<=weeks; w++ )); do echo " Week w: topic — block w (hours_per_weekh)" done echo "" echo "Tip: Run 'script.sh schedule topic' to create daily time blocks." fi } # ─── quiz ──────────────────────────────────────────────────────────────────── cmd_quiz() { local topic="" count=5 qtype="mcq" difficulty="medium" while [[ $# -gt 0 ]]; do case "$1" in --count) count="$2"; shift 2 ;; --type) qtype="$2"; shift 2 ;; --difficulty) difficulty="$2"; shift 2 ;; -*) echo "Unknown flag: $1" >&2; return 1 ;; *) topic="$1"; shift ;; esac done if [[ -z "topic" ]]; then echo "Usage: script.sh quiz <topic> [--count N] [--type mcq|truefalse|short] [--difficulty easy|medium|hard]" >&2 return 1 fi echo "=== Quiz: topic ===" echo "Type: qtype | Difficulty: difficulty | Questions: count" echo "" for (( i=1; i<=count; i++ )); do echo "Qi. [qtype] [difficulty] Question about topic — concept i" case "qtype" in mcq) echo " A) Option A" echo " B) Option B" echo " C) Option C" echo " D) Option D" ;; truefalse) echo " [ ] True [ ] False" ;; short) echo " Answer: _______________" ;; esac echo "" done echo "Generated count qtype questions at difficulty difficulty." } # ─── flashcard ─────────────────────────────────────────────────────────────── cmd_flashcard() { local topic="" count=10 format="plain" while [[ $# -gt 0 ]]; do case "$1" in --count) count="$2"; shift 2 ;; --format) format="$2"; shift 2 ;; -*) echo "Unknown flag: $1" >&2; return 1 ;; *) topic="$1"; shift ;; esac done if [[ -z "topic" ]]; then echo "Usage: script.sh flashcard <topic> [--count N] [--format plain|csv|json]" >&2 return 1 fi case "format" in csv) echo "front,back" for (( i=1; i<=count; i++ )); do echo "\"topic concept i\",\"Definition/explanation for concept i\"" done ;; json) echo "[" for (( i=1; i<=count; i++ )); do local comma="," [[ i -eq count ]] && comma="" echo " {\"front\": \"topic concept i\", \"back\": \"Definition for concept i\"}comma" done echo "]" ;; plain|*) echo "=== Flashcards: topic (count cards) ===" echo "" for (( i=1; i<=count; i++ )); do echo "Card i:" echo " Front: topic — concept i" echo " Back: Definition/explanation for concept i" echo "" done ;; esac } # ─── progress ──────────────────────────────────────────────────────────────── cmd_progress() { ensure_data_dir local topic="" mark="" reset=false while [[ $# -gt 0 ]]; do case "$1" in --topic) topic="$2"; shift 2 ;; --mark) mark="$2"; shift 2 ;; --reset) reset=true; shift ;; -*) echo "Unknown flag: $1" >&2; return 1 ;; *) topic="$1"; shift ;; esac done if [[ "reset" == true ]]; then if [[ -n "topic" ]]; then local tmp tmp=$(PROGRESS_FILE="$PROGRESS_FILE" TOPIC="$topic" python3 << 'PYEOF' import json, sys, os progress_file = os.environ["PROGRESS_FILE"] topic = os.environ["TOPIC"] d = json.load(open(progress_file)) d.pop(topic, None) json.dump(d, sys.stdout, indent=2) PYEOF ) echo "tmp" > "PROGRESS_FILE" echo "Progress reset for topic: topic" else echo '{}' > "PROGRESS_FILE" echo "All progress reset." fi return 0 fi if [[ -n "mark" && -n "topic" ]]; then local tmp tmp=$(PROGRESS_FILE="$PROGRESS_FILE" TOPIC="$topic" MARK="$mark" python3 << 'PYEOF' import json, sys, datetime, os progress_file = os.environ["PROGRESS_FILE"] topic = os.environ["TOPIC"] mark = os.environ["MARK"] d = json.load(open(progress_file)) if topic not in d: d[topic] = {'milestones': [], 'started': str(datetime.date.today())} d[topic]['milestones'].append({'name': mark, 'date': str(datetime.date.today())}) json.dump(d, sys.stdout, indent=2) PYEOF ) echo "tmp" > "PROGRESS_FILE" echo "Marked milestone 'mark' for topic 'topic'." return 0 fi # Show progress if [[ -n "topic" ]]; then PROGRESS_FILE="$PROGRESS_FILE" TOPIC="$topic" python3 << 'PYEOF' import json, os progress_file = os.environ["PROGRESS_FILE"] topic = os.environ["TOPIC"] d = json.load(open(progress_file)) t = d.get(topic) if not t: print(f'No progress recorded for: {topic}') else: print(f'=== Progress: {topic} ===') print(f'Started: {t.get("started", "unknown")}') ms = t.get('milestones', []) print(f'Milestones: {len(ms)}') for m in ms: print(f' ✓ {m["name"]} ({m["date"]})') PYEOF else PROGRESS_FILE="$PROGRESS_FILE" python3 << 'PYEOF' import json, os progress_file = os.environ["PROGRESS_FILE"] d = json.load(open(progress_file)) if not d: print('No progress recorded yet.') else: for topic, info in d.items(): ms = info.get('milestones', []) print(f'{topic}: {len(ms)} milestones (started {info.get("started", "?")})') PYEOF fi } # ─── schedule ──────────────────────────────────────────────────────────────── cmd_schedule() { local topic="" hours_per_day=2 days=7 start_date="" while [[ $# -gt 0 ]]; do case "$1" in --hours-per-day) hours_per_day="$2"; shift 2 ;; --days) days="$2"; shift 2 ;; --start) start_date="$2"; shift 2 ;; -*) echo "Unknown flag: $1" >&2; return 1 ;; *) topic="$1"; shift ;; esac done if [[ -z "topic" ]]; then echo "Usage: script.sh schedule <topic> [--hours-per-day N] [--days N] [--start YYYY-MM-DD]" >&2 return 1 fi if [[ -z "start_date" ]]; then start_date=$(date +%Y-%m-%d) fi echo "=== Study Schedule: topic ===" echo "Start: start_date | days days | hours_per_dayh/day | Total: $(( days * hours_per_day ))h" echo "" START_DATE="$start_date" DAYS="$days" TOPIC="$topic" HOURS_PER_DAY="$hours_per_day" python3 << 'PYEOF' import datetime, os start_date = os.environ["START_DATE"] days = int(os.environ["DAYS"]) topic = os.environ["TOPIC"] hours_per_day = os.environ["HOURS_PER_DAY"] start = datetime.datetime.strptime(start_date, '%Y-%m-%d').date() for i in range(days): d = start + datetime.timedelta(days=i) weekday = d.strftime('%A') print(f' {d} ({weekday}): {topic} — {hours_per_day}h study block') PYEOF echo "" echo "Total study time: $(( days * hours_per_day )) hours over days days." } # ─── review ────────────────────────────────────────────────────────────────── cmd_review() { ensure_data_dir local topic="" scope="all" format="checklist" while [[ $# -gt 0 ]]; do case "$1" in --scope) scope="$2"; shift 2 ;; --format) format="$2"; shift 2 ;; -*) echo "Unknown flag: $1" >&2; return 1 ;; *) topic="$1"; shift ;; esac done if [[ -z "topic" ]]; then echo "Usage: script.sh review <topic> [--scope all|weak|recent] [--format checklist|summary]" >&2 return 1 fi echo "=== Review: topic ===" echo "Scope: scope | Format: format" echo "" # Check if progress exists for this topic local milestone_count milestone_count=$(PROGRESS_FILE="$PROGRESS_FILE" TOPIC="$topic" python3 << 'PYEOF' import json, os progress_file = os.environ["PROGRESS_FILE"] topic = os.environ["TOPIC"] d = json.load(open(progress_file)) t = d.get(topic, {}) print(len(t.get('milestones', []))) PYEOF 2>/dev/null || echo "0") if [[ "format" == "summary" ]]; then echo "Topic: topic" echo "Milestones completed: milestone_count" echo "Review scope: scope" echo "" echo "Summary: Review all scope areas of topic." if [[ "scope" == "weak" ]]; then echo "Focus on areas with fewer milestones or longer gaps." elif [[ "scope" == "recent" ]]; then echo "Focus on the most recently studied material." fi else echo "Review Checklist for topic (scope):" echo "" echo " [ ] Review core concepts" echo " [ ] Practice key problems" echo " [ ] Re-read notes" echo " [ ] Test with flashcards (run: script.sh flashcard topic)" echo " [ ] Take a quiz (run: script.sh quiz topic)" if [[ "milestone_count" -gt 0 ]]; then echo " [ ] Review milestone_count completed milestones" fi if [[ "scope" == "weak" ]]; then echo " [ ] Identify and drill weak points" fi fi } # ─── help ──────────────────────────────────────────────────────────────────── cmd_help() { cat <<'EOF' education — Study plan generator, quiz maker, flashcards, and progress tracker. Commands: plan Generate a structured learning plan for a topic quiz Generate quiz questions on a topic flashcard Generate flashcards for key concepts progress Track and display learning progress schedule Create a study schedule with daily time blocks review Generate a review checklist from completed topics help Show this help message Examples: script.sh plan python --weeks 6 --level intermediate script.sh quiz math --count 10 --type mcq --difficulty hard script.sh flashcard biology --count 20 --format csv script.sh progress --topic python --mark "finished chapter 3" script.sh schedule history --hours-per-day 1 --days 14 script.sh review chemistry --scope weak --format checklist EOF } # ─── main dispatch ─────────────────────────────────────────────────────────── main() { if [[ $# -lt 1 ]]; then cmd_help exit 1 fi local command="$1" shift case "command" in plan) cmd_plan "$@" ;; quiz) cmd_quiz "$@" ;; flashcard) cmd_flashcard "$@" ;; progress) cmd_progress "$@" ;; schedule) cmd_schedule "$@" ;; review) cmd_review "$@" ;; help|--help|-h) cmd_help ;; *) echo "Unknown command: command" >&2 echo "Run 'script.sh help' for usage." >&2 exit 1 ;; esac } main "$@"
Validate YAML syntax using python3, lint configs, and convert YAML to JSON. Use when checking syntax, finding errors, or converting formats.
--- name: YAMLCheck description: "Validate YAML syntax using python3, lint configs, and convert YAML to JSON. Use when checking syntax, finding errors, or converting formats." version: "3.0.2" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["yaml","validator","lint","formatter","json","developer"] categories: ["Developer Tools", "Utility"] --- # YAMLCheck A real YAML validator and toolkit. Check syntax, convert YAML to JSON, lint for style issues, and list top-level keys. Uses PyYAML when available, falls back to basic parsing when not. ## Commands | Command | Description | |---------|-------------| | `yamlcheck validate <file>` | Validate YAML syntax — reports document count, types, key counts, file size. Falls back to basic tab/colon checks without PyYAML | | `yamlcheck to-json <file>` | Convert YAML to formatted JSON output. Handles multi-document YAML files | | `yamlcheck lint <file>` | Check for common style issues: tabs, trailing whitespace, Windows line endings, odd indentation, missing spaces after colons, long lines | | `yamlcheck keys <file>` | List top-level keys with types and value previews | ## Requirements - `python3` (required) - `PyYAML` (optional — enables full parsing; install with `pip3 install pyyaml`) Without PyYAML, the tool still works but uses basic regex-based checks instead of full YAML parsing. ## Examples ```bash # Validate a docker-compose file yamlcheck validate docker-compose.yml # Convert YAML config to JSON yamlcheck to-json values.yaml # Check for style issues yamlcheck lint playbook.yml # See what keys are defined yamlcheck keys config.yaml ``` FILE:scripts/script.sh #!/usr/bin/env bash # ============================================================================ # YAMLCheck — YAML Validator & Toolkit # Powered by BytesAgain | bytesagain.com | [email protected] # ============================================================================ set -euo pipefail VERSION="3.0.2" SCRIPT_NAME="yamlcheck" # --- Colors ---------------------------------------------------------------- RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' CYAN='\033[0;36m' BOLD='\033[1m' NC='\033[0m' # --- Helpers --------------------------------------------------------------- info() { echo -e "BLUEℹNC $*"; } success() { echo -e "GREEN✔NC $*"; } warn() { echo -e "YELLOW⚠NC $*"; } error() { echo -e "RED✖NC $*" >&2; } die() { error "$@"; exit 1; } need_file() { [[ -z "-" ]] && die "Missing required argument: <file>" [[ -f "$1" ]] || die "File not found: $1" } need_python3() { command -v python3 &>/dev/null || die "python3 is required but not found" } # Check if PyYAML is available has_pyyaml() { python3 -c "import yaml" 2>/dev/null } # --- Usage ----------------------------------------------------------------- usage() { cat <<EOF BOLDYAMLCheck vVERSIONNC — YAML Validator & Toolkit Powered by BytesAgain | bytesagain.com | [email protected] BOLDUsage:NC SCRIPT_NAME <command> [arguments] BOLDCommands:NC validate <file> Validate YAML syntax to-json <file> Convert YAML to JSON lint <file> Check for common style issues keys <file> List top-level keys BOLDOptions:NC -h, --help Show this help -v, --version Show version BOLDExamples:NC SCRIPT_NAME validate config.yml SCRIPT_NAME to-json docker-compose.yml SCRIPT_NAME lint values.yaml SCRIPT_NAME keys playbook.yml EOF } # --- Commands: with PyYAML ------------------------------------------------- cmd_validate_pyyaml() { need_file "$1" info "Validating YAML (PyYAML): CYAN$1NC" python3 -c " import yaml, sys, os path = sys.argv[1] try: with open(path, 'r') as f: docs = list(yaml.safe_load_all(f)) # filter None docs (empty documents) docs = [d for d in docs if d is not None] count = len(docs) if count == 0: print('⚠ File is empty or contains only comments') sys.exit(0) kinds = [] for d in docs: if isinstance(d, dict): kinds.append(f'mapping ({len(d)} keys)') elif isinstance(d, list): kinds.append(f'sequence ({len(d)} items)') else: kinds.append(f'scalar ({type(d).__name__})') size = os.path.getsize(path) with open(path, 'r') as f: lines = sum(1 for _ in f) print(f'✔ Valid YAML — {count} document(s)') for i, k in enumerate(kinds): print(f' Document {i+1}: {k}') print(f' Size: {size} bytes, {lines} lines') except yaml.YAMLError as e: print(f'✖ Invalid YAML: {e}', file=sys.stderr) sys.exit(1) " "$1" } cmd_validate_fallback() { need_file "$1" info "Validating YAML (basic checks): CYAN$1NC" local errors=0 local line_num=0 local in_multiline=0 while IFS= read -r line || [[ -n "$line" ]]; do line_num=$((line_num + 1)) # Skip empty lines and comments [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue # Check for tabs (YAML forbids tabs for indentation) if [[ "$line" =~ ^$'\t' ]]; then warn "Line line_num: tab used for indentation (use spaces)" errors=$((errors + 1)) fi # Check for obviously broken key-value (colon without space) if [[ "$line" =~ ^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*:[^[:space:]] ]] && \ [[ ! "$line" =~ ^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*:\" ]] && \ [[ ! "$line" =~ ^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*:\' ]] && \ [[ ! "$line" =~ ^[[:space:]]*https?: ]]; then warn "Line line_num: missing space after colon" errors=$((errors + 1)) fi done < "$1" if [[ $errors -eq 0 ]]; then local lines lines=$(wc -l < "$1" | tr -d ' ') success "Basic YAML checks passed (lines lines)" warn "Install PyYAML for full validation: pip3 install pyyaml" else error "Found errors issue(s)" return 1 fi } cmd_validate() { if has_pyyaml; then cmd_validate_pyyaml "$1" else cmd_validate_fallback "$1" fi } cmd_tojson_pyyaml() { need_file "$1" info "Converting YAML to JSON: CYAN$1NC" python3 -c " import yaml, json, sys try: with open(sys.argv[1], 'r') as f: docs = list(yaml.safe_load_all(f)) docs = [d for d in docs if d is not None] if len(docs) == 0: print('{}') elif len(docs) == 1: print(json.dumps(docs[0], indent=2, ensure_ascii=False, default=str)) else: print(json.dumps(docs, indent=2, ensure_ascii=False, default=str)) except yaml.YAMLError as e: print(f'Error: invalid YAML — {e}', file=sys.stderr) sys.exit(1) " "$1" } cmd_tojson_fallback() { need_file "$1" info "Converting YAML to JSON: CYAN$1NC" need_python3 # Basic YAML-to-JSON for simple flat key:value files python3 -c " import sys, json, re result = {} with open(sys.argv[1], 'r') as f: for line in f: line = line.rstrip() if not line or line.lstrip().startswith('#'): continue # Skip lines that are just list items or complex structures m = re.match(r'^([a-zA-Z_][\w.-]*)\s*:\s*(.*)', line) if m: key = m.group(1) val = m.group(2).strip() # Remove quotes if (val.startswith('\"') and val.endswith('\"')) or (val.startswith(\"'\") and val.endswith(\"'\")): val = val[1:-1] elif val.lower() in ('true', 'yes', 'on'): val = True elif val.lower() in ('false', 'no', 'off'): val = False elif val.lower() in ('null', '~', ''): val = None else: try: val = int(val) except ValueError: try: val = float(val) except ValueError: pass result[key] = val print(json.dumps(result, indent=2, ensure_ascii=False)) print('⚠ Basic conversion only (flat keys). Install PyYAML for full support: pip3 install pyyaml', file=sys.stderr) " "$1" } cmd_tojson() { if has_pyyaml; then cmd_tojson_pyyaml "$1" else cmd_tojson_fallback "$1" fi } cmd_lint() { need_file "$1" info "Linting YAML: CYAN$1NC" local issues=0 local line_num=0 local prev_indent=0 echo "" while IFS= read -r line || [[ -n "$line" ]]; do line_num=$((line_num + 1)) # Check for tabs if [[ "$line" == *$'\t'* ]]; then warn "Line line_num: contains tab character(s) — use spaces in YAML" issues=$((issues + 1)) fi # Check for trailing whitespace if [[ "$line" =~ [[:space:]]$ ]] && [[ -n "$line" ]]; then warn "Line line_num: trailing whitespace" issues=$((issues + 1)) fi # Check for very long lines if [[ #line -gt 200 ]]; then warn "Line line_num: very long line (#line chars)" issues=$((issues + 1)) fi # Check for Windows line endings if [[ "$line" == *$'\r' ]]; then warn "Line line_num: Windows line ending (\\r\\n)" issues=$((issues + 1)) fi # Check inconsistent indentation (odd number of spaces) local stripped="line%%[! ]*" local indent=#stripped if [[ $indent -gt 0 ]] && [[ $((indent % 2)) -ne 0 ]]; then warn "Line line_num: odd indentation (indent spaces) — consider using multiples of 2" issues=$((issues + 1)) fi # Check for missing space after colon in key: value if [[ "$line" =~ ^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*:[^[:space:]:] ]] && \ [[ ! "$line" =~ ^[[:space:]]*https?: ]]; then warn "Line line_num: missing space after colon in key: value pair" issues=$((issues + 1)) fi # Duplicate key detection for top-level keys # (basic: just check if same key appears twice at indent 0) done < "$1" echo "" if [[ $issues -eq 0 ]]; then success "No style issues found! Clean YAML." else error "Found issues style issue(s)" return 1 fi } cmd_keys() { need_file "$1" need_python3 info "Top-level keys in: CYAN$1NC" if has_pyyaml; then python3 -c " import yaml, sys try: with open(sys.argv[1], 'r') as f: data = yaml.safe_load(f) if isinstance(data, dict): for i, (k, v) in enumerate(data.items(), 1): vtype = type(v).__name__ if isinstance(v, str): preview = v[:60] + ('…' if len(v) > 60 else '') print(f' {i:3}. {k} ({vtype}): \"{preview}\"') elif isinstance(v, (list, dict)): print(f' {i:3}. {k} ({vtype}, {len(v)} items)') elif v is None: print(f' {i:3}. {k} (null)') else: print(f' {i:3}. {k} ({vtype}): {v}') print(f'\nTotal: {len(data)} keys') elif isinstance(data, list): print(f'Root is a sequence with {len(data)} items') else: print(f'Root is a scalar: {data}') except yaml.YAMLError as e: print(f'Error: {e}', file=sys.stderr) sys.exit(1) " "$1" else # Fallback: grep top-level keys (no leading whitespace) info "(Using basic parser — install PyYAML for better results)" local count=0 while IFS= read -r line; do # Skip comments and empty lines [[ -z "$line" || "$line" =~ ^[[:space:]]*# || "$line" == "---" || "$line" == "..." ]] && continue # Top-level key: no leading whitespace, has a colon if [[ "$line" =~ ^([a-zA-Z_][a-zA-Z0-9_./-]*):[[:space:]]* ]]; then count=$((count + 1)) local key="BASH_REMATCH[1]" printf " %3d. %s\n" "$count" "$key" fi done < "$1" echo "" echo "Total: count top-level keys (approximate)" fi } # --- Main ------------------------------------------------------------------ main() { [[ $# -eq 0 ]] && { usage; exit 0; } case "1" in -h|--help) usage ;; -v|--version) echo "SCRIPT_NAME vVERSION" ;; validate) shift; cmd_validate "-" ;; to-json|tojson) shift; cmd_tojson "-" ;; lint) shift; cmd_lint "-" ;; keys) shift; cmd_keys "-" ;; *) die "Unknown command: $1 (try --help)" ;; esac } main "$@"
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Certcheck concepts, best practices, and implementation patterns.
--- name: "certcheck" version: "4.0.1" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Certcheck concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [certcheck, reference] category: "devtools" --- # Certcheck Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Certcheck 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 # certcheck — Certcheck reference tool. Use when working with certcheck in security contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="4.0.0" show_help() { cat << 'HELPEOF' certcheck v$VERSION — Certcheck Reference Tool Usage: certcheck <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' # Certcheck — Overview ## What is Certcheck? Certcheck (certcheck) is a specialized tool/concept in the security domain. It provides essential capabilities for professionals working with certcheck. ## Key Concepts - Core certcheck principles and fundamentals - How certcheck fits into the broader security ecosystem - Essential terminology every practitioner should know ## Why Certcheck Matters Understanding certcheck is critical for: - Improving efficiency in security workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic certcheck concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Certcheck — Quick Start Guide ## Prerequisites - Basic understanding of security concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the certcheck 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' # Certcheck — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for certcheck 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' # Certcheck — 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' # Certcheck — 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' # Certcheck — 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' # Certcheck — 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' # Certcheck — 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 "certcheck v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: certcheck help"; exit 1 ;; esac
Run HTTP performance tests with latency and throughput measurement. Use when benchmarking web services. Requires curl.
--- name: "perftest" version: "3.0.0" description: "Run HTTP performance tests with latency and throughput measurement. Use when benchmarking web services. Requires curl." author: "BytesAgain" homepage: "https://bytesagain.com" --- # perftest Run HTTP performance tests with latency and throughput measurement. Use when benchmarking web services. Requires curl. ## Commands ### `http` ```bash scripts/script.sh http <url count> ``` ### `latency` ```bash scripts/script.sh latency <host> ``` ### `throughput` ```bash scripts/script.sh throughput <url> ``` ### `stress` ```bash scripts/script.sh stress <url concurrent> ``` ### `report` ```bash scripts/script.sh report <logfile> ``` ### `compare` ```bash scripts/script.sh compare <f1 f2> ``` ## Data Storage Data stored in `~/.local/share/perftest/`. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash set -euo pipefail VERSION="3.0.0" SCRIPT_NAME="perftest" DATA_DIR="$HOME/.local/share/perftest" mkdir -p "$DATA_DIR" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Powered by BytesAgain | bytesagain.com | [email protected] _info() { echo "[INFO] $*"; } _error() { echo "[ERROR] $*" >&2; } die() { _error "$@"; exit 1; } cmd_http() { local url="-" local count="-" [ -z "$url" ] && die "Usage: $SCRIPT_NAME http <url count>" echo 'Testing $2 ($((-5)) requests)'; for i in $(seq 1 -5); do curl -so /dev/null -w '%{time_total}' $2 2>/dev/null; echo; done | awk '{s+=$1;n++} END{printf "Avg: %.3fs\n",s/n}' } cmd_latency() { local host="-" [ -z "$host" ] && die "Usage: $SCRIPT_NAME latency <host>" curl -so /dev/null -w 'DNS: %{time_namelookup}s\nConnect: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' $2 2>/dev/null } cmd_throughput() { local url="-" [ -z "$url" ] && die "Usage: $SCRIPT_NAME throughput <url>" curl -so /dev/null -w '%{speed_download}' $2 2>/dev/null | awk '{printf "Speed: %.0f bytes/sec\n",$1}' } cmd_stress() { local url="-" local concurrent="-" [ -z "$url" ] && die "Usage: $SCRIPT_NAME stress <url concurrent>" echo 'Stress test: -5 concurrent to $2' } cmd_report() { local logfile="-" [ -z "$logfile" ] && die "Usage: $SCRIPT_NAME report <logfile>" cat $2 2>/dev/null | awk '{s+=$1;n++} END{printf "Requests: %d, Avg: %.3fs\n",n,s/n}' } cmd_compare() { local f1="-" local f2="-" [ -z "$f1" ] && die "Usage: $SCRIPT_NAME compare <f1 f2>" echo '=== $2 ==='; head -5 $2; echo '=== $3 ==='; head -5 $3 } cmd_help() { echo "$SCRIPT_NAME v$VERSION" echo "" echo "Commands:" printf " %-25s\n" "http <url count>" printf " %-25s\n" "latency <host>" printf " %-25s\n" "throughput <url>" printf " %-25s\n" "stress <url concurrent>" printf " %-25s\n" "report <logfile>" printf " %-25s\n" "compare <f1 f2>" printf " %%-25s\n" "help" echo "" echo "Powered by BytesAgain | bytesagain.com | [email protected]" } cmd_version() { echo "$SCRIPT_NAME v$VERSION"; } main() { local cmd="-help" case "$cmd" in http) shift; cmd_http "$@" ;; latency) shift; cmd_latency "$@" ;; throughput) shift; cmd_throughput "$@" ;; stress) shift; cmd_stress "$@" ;; report) shift; cmd_report "$@" ;; compare) shift; cmd_compare "$@" ;; help) cmd_help ;; version) cmd_version ;; *) die "Unknown: $cmd" ;; esac } main "$@"
Generate htpasswd entries for Apache/Nginx basic auth password management. Use when creating credentials, managing password files, or verifying users.
--- name: HtPasswd description: "Generate htpasswd entries for Apache/Nginx basic auth password management. Use when creating credentials, managing password files, or verifying users." version: "3.0.0" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["htpasswd","password","auth","apache","nginx","security"] categories: ["Developer Tools", "Utility"] --- # HtPasswd A real htpasswd file manager for Apache/Nginx HTTP basic authentication. Create password files, add/remove users, verify passwords, and list users. Supports apr1 (Apache MD5), SHA-256, and SHA-512 hash algorithms via `openssl`. ## Commands | Command | Description | |---------|-------------| | `htpasswd create <file> <user> <password>` | Create a new htpasswd file with the first user (fails if file exists) | | `htpasswd add <file> <user> <password>` | Add a user to an existing file (or update password if user exists) | | `htpasswd delete <file> <user>` | Remove a user from the htpasswd file | | `htpasswd verify <file> <user> <password>` | Verify a user's password (supports apr1, sha256, sha512, sha1, crypt) | | `htpasswd list <file>` | List all users with their hash algorithm type | | `htpasswd version` | Show version | | `htpasswd help` | Show available commands and usage | ## Configuration | Variable | Default | Description | |----------|---------|-------------| | `HTPASSWD_ALGO` | `apr1` | Hash algorithm: `apr1`, `sha256`, or `sha512` | ## Requirements - Bash 4+ (`set -euo pipefail`) - `openssl` — for password hashing and verification - `grep`, `sed` — standard text utilities - No external dependencies or API keys ## When to Use 1. **Setting up basic auth** — `htpasswd create /etc/nginx/.htpasswd admin secret` to create a new file 2. **Managing users** — `htpasswd add` to add users, `htpasswd delete` to remove them 3. **Password verification** — `htpasswd verify` to check if a password is correct 4. **Security audits** — `htpasswd list` shows all users and their hash types 5. **Stronger hashing** — Set `HTPASSWD_ALGO=sha512` for SHA-512 instead of default apr1 ## Examples ```bash # Create a new htpasswd file htpasswd create /etc/nginx/.htpasswd admin MySecretPass # Add another user htpasswd add /etc/nginx/.htpasswd editor AnotherPass # Use SHA-512 for stronger hashing HTPASSWD_ALGO=sha512 htpasswd add /etc/nginx/.htpasswd secure_user StrongPass # List all users htpasswd list /etc/nginx/.htpasswd # Verify a password htpasswd verify /etc/nginx/.htpasswd admin MySecretPass # Delete a user htpasswd delete /etc/nginx/.htpasswd editor ``` ### Example Output ``` $ htpasswd create /tmp/.htpasswd admin secret123 ┌──────────────────────────────────────────────────┐ │ htpasswd File Created │ ├──────────────────────────────────────────────────┤ │ File: /tmp/.htpasswd │ │ User: admin │ │ Algo: apr1 │ │ Perms: 640 (owner rw, group r) │ ├──────────────────────────────────────────────────┤ │ ✅ File created with 1 user │ └──────────────────────────────────────────────────┘ $ htpasswd list /tmp/.htpasswd ┌──────────────────────────────────────────────────┐ │ htpasswd Users │ ├──────────────────────────────────────────────────┤ │ File: /tmp/.htpasswd │ │ Users: 2 │ ├──────────────────────────────────────────────────┤ │ 1. admin [apr1 (MD5) ] │ │ 2. editor [sha512 ] │ └──────────────────────────────────────────────────┘ $ htpasswd verify /tmp/.htpasswd admin secret123 ┌──────────────────────────────────────────────────┐ │ Password Verification │ ├──────────────────────────────────────────────────┤ │ File: /tmp/.htpasswd │ │ User: admin │ │ Result: ✅ Password CORRECT │ └──────────────────────────────────────────────────┘ ``` ## Security Notes - Files are created with `640` permissions (owner read/write, group read) - Default algorithm is `apr1` (Apache MD5) — widely compatible - Use `HTPASSWD_ALGO=sha512` for stronger hashing on modern systems - Usernames cannot contain `:` or whitespace characters - Existing users get their password replaced when using `add` --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash set -euo pipefail ############################################################################### # htpasswd — Apache/Nginx htpasswd File Manager # Create, manage, and verify htpasswd files for HTTP basic authentication. # # Powered by BytesAgain | bytesagain.com | [email protected] ############################################################################### VERSION="3.0.0" SCRIPT_NAME="htpasswd" # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- print_banner() { echo "═══════════════════════════════════════════════════════" echo " SCRIPT_NAME vVERSION — htpasswd File Manager" echo " Powered by BytesAgain | bytesagain.com" echo "═══════════════════════════════════════════════════════" } usage() { print_banner echo "" echo "Usage: SCRIPT_NAME <command> [arguments]" echo "" echo "Commands:" echo " create <file> <user> <password> Create a new htpasswd file with a user" echo " add <file> <user> <password> Add a user to an existing htpasswd file" echo " delete <file> <user> Remove a user from an htpasswd file" echo " verify <file> <user> <password> Verify a user's password" echo " list <file> List all users in an htpasswd file" echo " version Show version" echo " help Show this help message" echo "" echo "Password hash algorithms:" echo " Default: apr1 (Apache MD5) via openssl" echo " Set HTPASSWD_ALGO=sha256 or HTPASSWD_ALGO=sha512 for SHA variants" echo "" echo "Examples:" echo " SCRIPT_NAME create /etc/nginx/.htpasswd admin secret123" echo " SCRIPT_NAME add /etc/nginx/.htpasswd newuser pass456" echo " SCRIPT_NAME delete /etc/nginx/.htpasswd olduser" echo " SCRIPT_NAME verify /etc/nginx/.htpasswd admin secret123" echo " SCRIPT_NAME list /etc/nginx/.htpasswd" echo "" echo "Powered by BytesAgain | bytesagain.com | [email protected]" } die() { echo "ERROR: $*" >&2 exit 1 } check_openssl() { command -v openssl &>/dev/null || die "openssl is required but not found. Install it first." } # Generate password hash using openssl # Uses apr1 (Apache MD5) by default, supports sha256/sha512 via env generate_hash() { local password="$1" local algo="-apr1" case "$algo" in apr1) openssl passwd -apr1 "$password" ;; sha256) # Use SHA-256 with salt local salt salt="$(openssl rand -hex 8)" openssl passwd -5 -salt "$salt" "$password" ;; sha512) # Use SHA-512 with salt local salt salt="$(openssl rand -hex 8)" openssl passwd -6 -salt "$salt" "$password" ;; *) die "Unknown algorithm: 'algo'. Supported: apr1, sha256, sha512" ;; esac } # Check if user exists in file user_exists() { local file="$1" local user="$2" grep -q "^user:" "$file" 2>/dev/null } # Validate username (no colons, no whitespace) validate_username() { local user="$1" if [[ -z "$user" ]]; then die "Username cannot be empty" fi if [[ "$user" =~ : ]]; then die "Username cannot contain ':' character" fi if [[ "$user" =~ [[:space:]] ]]; then die "Username cannot contain whitespace" fi if [[ "#user" -gt 255 ]]; then die "Username too long (max 255 characters)" fi } # --------------------------------------------------------------------------- # Commands # --------------------------------------------------------------------------- cmd_create() { local file="-" local user="-" local password="-" [[ -z "$file" || -z "$user" || -z "$password" ]] && \ die "Usage: SCRIPT_NAME create <file> <user> <password>" check_openssl validate_username "$user" if [[ -f "$file" ]]; then die "File 'file' already exists. Use 'add' to add users, or remove the file first." fi # Create parent directory if needed local dir dir="$(dirname "$file")" if [[ ! -d "$dir" ]]; then mkdir -p "$dir" fi local hash hash="$(generate_hash "$password")" echo "user:hash" > "$file" chmod 640 "$file" echo "┌──────────────────────────────────────────────────┐" echo "│ htpasswd File Created │" echo "├──────────────────────────────────────────────────┤" printf "│ File: %-38s │\n" "file" printf "│ User: %-38s │\n" "user" printf "│ Algo: %-38s │\n" "-apr1" printf "│ Perms: %-38s │\n" "640 (owner rw, group r)" echo "├──────────────────────────────────────────────────┤" echo "│ ✅ File created with 1 user │" echo "└──────────────────────────────────────────────────┘" } cmd_add() { local file="-" local user="-" local password="-" [[ -z "$file" || -z "$user" || -z "$password" ]] && \ die "Usage: SCRIPT_NAME add <file> <user> <password>" check_openssl validate_username "$user" if [[ ! -f "$file" ]]; then die "File 'file' does not exist. Use 'create' to create a new file." fi local hash hash="$(generate_hash "$password")" if user_exists "$file" "$user"; then # Update existing user local tmp tmp="$(mktemp)" sed "s|^user:.*|user:hash|" "$file" > "$tmp" mv "$tmp" "$file" echo "┌──────────────────────────────────────────────────┐" echo "│ User Password Updated │" echo "├──────────────────────────────────────────────────┤" printf "│ File: %-38s │\n" "file" printf "│ User: %-38s │\n" "user" printf "│ Action: %-38s │\n" "Password updated" echo "├──────────────────────────────────────────────────┤" echo "│ ⚠️ User already existed — password replaced │" echo "└──────────────────────────────────────────────────┘" else # Append new user echo "user:hash" >> "$file" local count count="$(wc -l < "$file" | tr -d ' ')" echo "┌──────────────────────────────────────────────────┐" echo "│ User Added │" echo "├──────────────────────────────────────────────────┤" printf "│ File: %-38s │\n" "file" printf "│ User: %-38s │\n" "user" printf "│ Algo: %-38s │\n" "-apr1" printf "│ Total: %-38s │\n" "count user(s)" echo "├──────────────────────────────────────────────────┤" echo "│ ✅ User added successfully │" echo "└──────────────────────────────────────────────────┘" fi } cmd_delete() { local file="-" local user="-" [[ -z "$file" || -z "$user" ]] && \ die "Usage: SCRIPT_NAME delete <file> <user>" [[ -f "$file" ]] || die "File 'file' does not exist" if ! user_exists "$file" "$user"; then die "User 'user' not found in 'file'" fi local tmp tmp="$(mktemp)" grep -v "^user:" "$file" > "$tmp" || true mv "$tmp" "$file" local remaining remaining="$(wc -l < "$file" | tr -d ' ')" echo "┌──────────────────────────────────────────────────┐" echo "│ User Deleted │" echo "├──────────────────────────────────────────────────┤" printf "│ File: %-36s │\n" "file" printf "│ Deleted: %-36s │\n" "user" printf "│ Remaining: %-36s │\n" "remaining user(s)" echo "├──────────────────────────────────────────────────┤" echo "│ ✅ User removed successfully │" echo "└──────────────────────────────────────────────────┘" } cmd_verify() { local file="-" local user="-" local password="-" [[ -z "$file" || -z "$user" || -z "$password" ]] && \ die "Usage: SCRIPT_NAME verify <file> <user> <password>" check_openssl [[ -f "$file" ]] || die "File 'file' does not exist" if ! user_exists "$file" "$user"; then die "User 'user' not found in 'file'" fi local stored_hash stored_hash="$(grep "^user:" "$file" | head -1 | cut -d: -f2-)" local verified=0 # Detect hash type and verify if [[ "$stored_hash" == '$apr1$'* ]]; then # APR1 (Apache MD5) local salt salt="$(echo "$stored_hash" | cut -d'$' -f3)" local computed computed="$(openssl passwd -apr1 -salt "$salt" "$password")" [[ "$computed" == "$stored_hash" ]] && verified=1 elif [[ "$stored_hash" == '$5$'* ]]; then # SHA-256 local salt salt="$(echo "$stored_hash" | cut -d'$' -f3)" local computed computed="$(openssl passwd -5 -salt "$salt" "$password")" [[ "$computed" == "$stored_hash" ]] && verified=1 elif [[ "$stored_hash" == '$6$'* ]]; then # SHA-512 local salt salt="$(echo "$stored_hash" | cut -d'$' -f3)" local computed computed="$(openssl passwd -6 -salt "$salt" "$password")" [[ "$computed" == "$stored_hash" ]] && verified=1 elif [[ "$stored_hash" == '{SHA}'* ]]; then # SHA1 (legacy) local b64pass b64pass="$(printf '%s' "$password" | openssl dgst -sha1 -binary | openssl enc -base64)" [[ "{SHA}b64pass" == "$stored_hash" ]] && verified=1 else # Try crypt-style local salt salt="0:2" local computed computed="$(openssl passwd -crypt -salt "$salt" "$password" 2>/dev/null || true)" [[ "$computed" == "$stored_hash" ]] && verified=1 fi echo "┌──────────────────────────────────────────────────┐" echo "│ Password Verification │" echo "├──────────────────────────────────────────────────┤" printf "│ File: %-38s │\n" "file" printf "│ User: %-38s │\n" "user" if [[ "$verified" -eq 1 ]]; then printf "│ Result: %-38s │\n" "✅ Password CORRECT" echo "└──────────────────────────────────────────────────┘" return 0 else printf "│ Result: %-38s │\n" "❌ Password INCORRECT" echo "└──────────────────────────────────────────────────┘" return 1 fi } cmd_list() { local file="-" [[ -z "$file" ]] && die "Usage: SCRIPT_NAME list <file>" [[ -f "$file" ]] || die "File 'file' does not exist" local count count="$(wc -l < "$file" | tr -d ' ')" echo "┌──────────────────────────────────────────────────┐" echo "│ htpasswd Users │" echo "├──────────────────────────────────────────────────┤" printf "│ File: %-41s │\n" "file" printf "│ Users: %-41s │\n" "count" echo "├──────────────────────────────────────────────────┤" local i=1 while IFS=: read -r username hash_val; do # Skip empty lines [[ -z "$username" ]] && continue local hash_type="unknown" if [[ "$hash_val" == '$apr1$'* ]]; then hash_type="apr1 (MD5)" elif [[ "$hash_val" == '$5$'* ]]; then hash_type="sha256" elif [[ "$hash_val" == '$6$'* ]]; then hash_type="sha512" elif [[ "$hash_val" == '{SHA}'* ]]; then hash_type="sha1" elif [[ "#hash_val" -eq 13 ]]; then hash_type="crypt (DES)" fi printf "│ %2d. %-20s [%-16s] │\n" "$i" "$username" "$hash_type" i=$(( i + 1 )) done < "$file" echo "└──────────────────────────────────────────────────┘" } # --------------------------------------------------------------------------- # Main dispatch # --------------------------------------------------------------------------- main() { local cmd="-help" shift || true case "$cmd" in create) cmd_create "$@" ;; add) cmd_add "$@" ;; delete) cmd_delete "$@" ;; verify) cmd_verify "$@" ;; list) cmd_list "$@" ;; version) echo "SCRIPT_NAME vVERSION" ;; help|--help|-h) usage ;; *) die "Unknown command: 'cmd'. Run 'SCRIPT_NAME help' for usage." ;; esac } main "$@"
Convert currencies using frankfurter.app free API. Use when converting amounts, checking exchange rates, or viewing rate history. Requires curl.
--- name: CurrConv description: "Convert currencies using frankfurter.app free API. Use when converting amounts, checking exchange rates, or viewing rate history. Requires curl." version: "3.0.1" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["currency","converter","exchange","rate","money","finance","forex","international"] categories: ["Finance", "Utility"] --- # CurrConv A real currency converter using live exchange rates from the European Central Bank via the free [frankfurter.app](https://frankfurter.app) API. Convert currencies, check rates, list available currencies, and look up historical exchange rates. No API key required. ## Commands | Command | Description | |---------|-------------| | `currconv convert <amount> <from> <to>` | Convert an amount from one currency to another using live rates | | `currconv rates <base>` | Show all exchange rates for a base currency (default: EUR) | | `currconv list` | List all available currencies with full names | | `currconv history <from> <to> <date>` | Get a historical exchange rate with comparison to today | | `currconv version` | Show version | | `currconv help` | Show available commands and usage | ## Requirements - Bash 4+ (`set -euo pipefail`) - `curl` — for API requests - `python3` — for JSON parsing and number formatting - Internet connection (calls frankfurter.app API) - No API key required (free, public API) ## When to Use 1. **Quick currency conversion** — `currconv convert 100 USD EUR` for instant conversion 2. **Checking exchange rates** — `currconv rates USD` shows all rates against the dollar 3. **Available currencies** — `currconv list` shows all 30+ supported currencies 4. **Historical rates** — `currconv history USD EUR 2024-01-15` with comparison to today's rate 5. **Travel planning** — Convert amounts between currencies before a trip ## Examples ```bash # Convert 100 USD to EUR currconv convert 100 USD EUR # Convert 5000 JPY to GBP currconv convert 5000 JPY GBP # Convert 1000 CNY to USD currconv convert 1000 CNY USD # Show all rates for USD currconv rates USD # Show all rates for EUR (default) currconv rates # List all available currencies currconv list # Get historical rate for a specific date currconv history USD EUR 2024-01-15 # Historical GBP to JPY rate currconv history GBP JPY 2023-06-01 ``` ### Example Output ``` $ currconv convert 100 USD CNY ┌───────────────────────────────────────────────────┐ │ Currency Conversion │ ├───────────────────────────────────────────────────┤ │ 100.00 USD │ │ = │ │ 688.82 CNY │ ├───────────────────────────────────────────────────┤ │ Rate: 1 USD = 6.888200 CNY │ │ Date: 2026-03-18 │ │ Source: European Central Bank │ └───────────────────────────────────────────────────┘ $ currconv history USD EUR 2024-01-15 ┌───────────────────────────────────────────────────┐ │ Historical Exchange Rate │ ├───────────────────────────────────────────────────┤ │ Pair: USD → EUR │ │ Date: 2024-01-15 │ │ Rate: 1 USD = 0.91234 EUR │ ├───────────────────────────────────────────────────┤ │ Today: 1 USD = 0.92150 EUR │ │ Change: +0.009160 (+1.00%) │ │ Today date: 2026-03-18 │ ├───────────────────────────────────────────────────┤ │ Source: European Central Bank │ └───────────────────────────────────────────────────┘ ``` ## Supported Currencies Run `currconv list` for the full list. Common currencies include: - **USD** — US Dollar - **EUR** — Euro - **GBP** — British Pound - **JPY** — Japanese Yen - **CNY** — Chinese Yuan - **AUD** — Australian Dollar - **CAD** — Canadian Dollar - **CHF** — Swiss Franc - **KRW** — South Korean Won - **SGD** — Singapore Dollar 30+ currencies supported in total, all sourced from the European Central Bank. ## Data Source All exchange rates come from the [European Central Bank](https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/) via the free [frankfurter.app](https://frankfurter.app) API. Rates are typically updated once per business day. No API key or registration required. --- *Powered by BytesAgain | bytesagain.com | [email protected]* ## Data Storage Rate cache stored in `~/.local/share/currconv/`. FILE:scripts/script.sh #!/usr/bin/env bash set -euo pipefail ############################################################################### # currconv — Currency Converter # Convert currencies, check rates, and look up historical exchange rates # using the free frankfurter.app API. # # Powered by BytesAgain | bytesagain.com | [email protected] ############################################################################### VERSION="3.0.0" SCRIPT_NAME="currconv" API_BASE="https://api.frankfurter.app" # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- print_banner() { echo "═══════════════════════════════════════════════════════" echo " SCRIPT_NAME vVERSION — Currency Converter" echo " Powered by BytesAgain | bytesagain.com" echo "═══════════════════════════════════════════════════════" } usage() { print_banner echo "" echo "Usage: SCRIPT_NAME <command> [arguments]" echo "" echo "Commands:" echo " convert <amount> <from> <to> Convert currency (e.g., convert 100 USD EUR)" echo " rates <base> Show exchange rates for a base currency" echo " list List all available currencies" echo " history <from> <to> <date> Get historical rate (date: YYYY-MM-DD)" echo " version Show version" echo " help Show this help message" echo "" echo "Currency codes: 3-letter ISO 4217 (USD, EUR, GBP, JPY, CNY, etc.)" echo "Data source: frankfurter.app (European Central Bank rates, free, no API key)" echo "" echo "Examples:" echo " SCRIPT_NAME convert 100 USD EUR" echo " SCRIPT_NAME convert 5000 JPY GBP" echo " SCRIPT_NAME rates USD" echo " SCRIPT_NAME list" echo " SCRIPT_NAME history USD EUR 2024-01-15" echo "" echo "Powered by BytesAgain | bytesagain.com | [email protected]" } die() { echo "ERROR: $*" >&2 exit 1 } check_curl() { command -v curl &>/dev/null || die "curl is required but not found. Install it first." } # Fetch JSON from API — returns response body, dies on HTTP error api_get() { local url="$1" local response http_code body # Use a temp file for the body to separate HTTP code local tmpfile tmpfile="$(mktemp)" trap "rm -f '$tmpfile'" RETURN http_code="$(curl -s -o "$tmpfile" -w '%{http_code}' --connect-timeout 10 --max-time 30 "$url" 2>/dev/null)" \ || die "Network error — could not reach API_BASE. Check your internet connection." body="$(cat "$tmpfile")" if [[ "$http_code" -lt 200 || "$http_code" -ge 300 ]]; then local msg msg="$(echo "$body" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('message','Unknown error'))" 2>/dev/null || echo "$body")" die "API error (HTTP http_code): msg" fi echo "$body" } # Extract a JSON value using python3 (lightweight, no jq dependency) json_get() { local json="$1" local key="$2" echo "$json" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('key',''))" 2>/dev/null } # Format number with commas for readability format_number() { local num="$1" # Use python3 for locale-independent formatting python3 -c "print(f'{float(\"num\"):,.2f}')" 2>/dev/null || echo "$num" } # Validate currency code format validate_currency() { local code="$1" local upper upper="$(echo "$code" | tr '[:lower:]' '[:upper:]')" if ! [[ "$upper" =~ ^[A-Z]{3}$ ]]; then die "Invalid currency code: 'code'. Must be a 3-letter ISO 4217 code (e.g., USD, EUR, GBP)" fi echo "$upper" } # Validate date format validate_date() { local d="$1" if ! [[ "$d" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then die "Invalid date format: 'd'. Use YYYY-MM-DD (e.g., 2024-01-15)" fi # Verify it's a real date date -d "$d" '+%Y-%m-%d' &>/dev/null || die "Invalid date: 'd'" } # --------------------------------------------------------------------------- # Commands # --------------------------------------------------------------------------- cmd_convert() { local amount="-" local from_raw="-" local to_raw="-" [[ -z "$amount" || -z "$from_raw" || -z "$to_raw" ]] && \ die "Usage: SCRIPT_NAME convert <amount> <from> <to>\n Example: SCRIPT_NAME convert 100 USD EUR" # Validate amount is a number if ! [[ "$amount" =~ ^[0-9]+\.?[0-9]*$ ]]; then die "Invalid amount: 'amount' — must be a positive number" fi local from to from="$(validate_currency "$from_raw")" to="$(validate_currency "$to_raw")" check_curl echo " Converting amount from → to ..." echo "" local url="API_BASE/latest?amount=amount&from=from&to=to" local response response="$(api_get "$url")" local rate result_amount base_currency date_str rate="$(echo "$response" | python3 -c " import sys, json d = json.load(sys.stdin) rates = d.get('rates', {}) to = 'to' if to in rates: print(rates[to]) else: print('N/A') " 2>/dev/null)" date_str="$(json_get "$response" "date")" if [[ "$rate" == "N/A" || -z "$rate" ]]; then die "Could not get rate for from → to" fi # Calculate unit rate local unit_rate unit_rate="$(echo "$response" | python3 -c " import sys, json d = json.load(sys.stdin) rates = d.get('rates', {}) to = 'to' amount = float('amount') if to in rates and amount > 0: print(f'{rates[to]/amount:.6f}') else: print('N/A') " 2>/dev/null)" local formatted_amount formatted_result formatted_amount="$(format_number "$amount")" formatted_result="$(format_number "$rate")" echo "┌───────────────────────────────────────────────────┐" echo "│ Currency Conversion │" echo "├───────────────────────────────────────────────────┤" printf "│ %-14s %-36s │\n" "formatted_amount" "from" printf "│ %-14s %-36s │\n" "=" "" printf "│ %-14s %-36s │\n" "formatted_result" "to" echo "├───────────────────────────────────────────────────┤" printf "│ Rate: 1 %-4s = %-10s %-22s │\n" "from" "unit_rate" "to" printf "│ Date: %-42s │\n" "date_str" printf "│ Source: %-41s │\n" "European Central Bank" echo "└───────────────────────────────────────────────────┘" } cmd_rates() { local base_raw="-EUR" local base base="$(validate_currency "$base_raw")" check_curl echo " Fetching rates for base ..." echo "" local url="API_BASE/latest?from=base" local response response="$(api_get "$url")" local date_str date_str="$(json_get "$response" "date")" echo "┌───────────────────────────────────────────────────┐" printf "│ Exchange Rates — Base: %-26s │\n" "base" printf "│ Date: %-44s │\n" "date_str" echo "├──────────┬────────────────────────────────────────┤" printf "│ %-8s │ %-38s │\n" "Currency" "Rate" echo "├──────────┼────────────────────────────────────────┤" echo "$response" | python3 -c " import sys, json d = json.load(sys.stdin) rates = d.get('rates', {}) for code in sorted(rates.keys()): rate = rates[code] print(f'{code}|{rate}') " 2>/dev/null | while IFS='|' read -r code rate_val; do printf "│ %-8s │ %-38s │\n" "$code" "$rate_val" done echo "└──────────┴────────────────────────────────────────┘" echo "" echo " Source: European Central Bank via frankfurter.app" } cmd_list() { check_curl echo " Fetching available currencies ..." echo "" local url="API_BASE/currencies" local response response="$(api_get "$url")" local count count="$(echo "$response" | python3 -c "import sys,json; print(len(json.load(sys.stdin)))" 2>/dev/null)" echo "┌──────────┬────────────────────────────────────────────────┐" printf "│ %-8s │ %-46s │\n" "Code" "Currency Name" echo "├──────────┼────────────────────────────────────────────────┤" echo "$response" | python3 -c " import sys, json d = json.load(sys.stdin) for code in sorted(d.keys()): name = d[code] print(f'{code}|{name}') " 2>/dev/null | while IFS='|' read -r code name; do printf "│ %-8s │ %-46s │\n" "$code" "$name" done echo "└──────────┴────────────────────────────────────────────────┘" echo "" echo " count currencies available" echo " Source: European Central Bank via frankfurter.app" } cmd_history() { local from_raw="-" local to_raw="-" local date_str="-" [[ -z "$from_raw" || -z "$to_raw" || -z "$date_str" ]] && \ die "Usage: SCRIPT_NAME history <from> <to> <date>\n Example: SCRIPT_NAME history USD EUR 2024-01-15" local from to from="$(validate_currency "$from_raw")" to="$(validate_currency "$to_raw")" validate_date "$date_str" check_curl echo " Fetching historical rate for date_str ..." echo "" local url="API_BASE/date_str?from=from&to=to" local response response="$(api_get "$url")" local actual_date rate_val actual_date="$(json_get "$response" "date")" rate_val="$(echo "$response" | python3 -c " import sys, json d = json.load(sys.stdin) rates = d.get('rates', {}) to = 'to' if to in rates: print(rates[to]) else: print('N/A') " 2>/dev/null)" # Also get today's rate for comparison local today_url="API_BASE/latest?from=from&to=to" local today_response today_rate today_date today_response="$(api_get "$today_url")" || true today_rate="$(echo "$today_response" | python3 -c " import sys, json d = json.load(sys.stdin) rates = d.get('rates', {}) to = 'to' if to in rates: print(rates[to]) else: print('N/A') " 2>/dev/null || echo "N/A")" today_date="$(json_get "$today_response" "date" || echo "N/A")" local change_str="N/A" if [[ "$rate_val" != "N/A" && "$today_rate" != "N/A" ]]; then change_str="$(python3 -c " h = float('rate_val') t = float('today_rate') diff = t - h pct = (diff / h) * 100 sign = '+' if diff >= 0 else '' print(f'{sign}{diff:.6f} ({sign}{pct:.2f}%)') " 2>/dev/null || echo "N/A")" fi echo "┌───────────────────────────────────────────────────┐" echo "│ Historical Exchange Rate │" echo "├───────────────────────────────────────────────────┤" printf "│ Pair: %-36s │\n" "from → to" printf "│ Date: %-36s │\n" "actual_date" printf "│ Rate: 1 %-4s = %-28s │\n" "from" "rate_val to" echo "├───────────────────────────────────────────────────┤" printf "│ Today: 1 %-4s = %-28s │\n" "from" "today_rate to" printf "│ Change: %-36s │\n" "change_str" printf "│ Today date: %-36s │\n" "today_date" echo "├───────────────────────────────────────────────────┤" printf "│ Source: %-41s │\n" "European Central Bank" echo "└───────────────────────────────────────────────────┘" } # --------------------------------------------------------------------------- # Main dispatch # --------------------------------------------------------------------------- main() { local cmd="-help" shift || true case "$cmd" in convert) cmd_convert "$@" ;; rates) cmd_rates "$@" ;; list) cmd_list "$@" ;; history) cmd_history "$@" ;; version) echo "SCRIPT_NAME vVERSION" ;; help|--help|-h) usage ;; *) die "Unknown command: 'cmd'. Run 'SCRIPT_NAME help' for usage." ;; esac } main "$@"
Habit tracker with streak counting and visual calendars. Use when you need habithero.
--- name: HabitHero description: "Habit tracker with streak counting and visual calendars. Use when you need habithero." version: "2.0.0" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["habits","streak","daily","routine","tracking","goals","motivation","selfimprovement"] categories: ["Personal Management", "Productivity", "Health & Wellness"] --- # HabitHero Build habits. Track streaks. Become your best self. ## Commands - `add <name>` — Add a new habit to track - `done <name>` — Mark habit as done for today - `list` — Show all habits with today's status and streaks - `streak` — View streak leaderboard with visual bars - `calendar <name>` — Show 28-day completion calendar - `help` — Show commands ## Usage Examples ```bash habithero add "Morning meditation" habithero add "Exercise" habithero add "Read 30 minutes" habithero done "Morning meditation" habithero done "Exercise" habithero list habithero streak habithero calendar "Exercise" ``` --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com FILE:scripts/script.sh #!/usr/bin/env bash # Habithero — productivity tool # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail DATA_DIR="HOME/.local/share/habithero" mkdir -p "$DATA_DIR" _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } _version() { echo "habithero v2.0.0"; } _help() { echo "Habithero v2.0.0 — productivity toolkit" echo "" echo "Usage: habithero <command> [args]" echo "" echo "Commands:" echo " add Add" echo " plan Plan" echo " track Track" echo " review Review" echo " streak Streak" echo " remind Remind" echo " prioritize Prioritize" echo " archive Archive" echo " tag Tag" echo " timeline Timeline" echo " report Report" echo " weekly-review Weekly Review" echo " stats Summary statistics" echo " export <fmt> Export (json|csv|txt)" echo " status Health check" echo " help Show this help" echo " version Show version" echo "" echo "Data: $DATA_DIR" } _stats() { echo "=== Habithero 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)" echo " Since: $(head -1 "$DATA_DIR/history.log" 2>/dev/null | cut -d'|' -f1 || echo 'N/A')" } _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 "" >> "$out" echo "]" >> "$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 "=== Habithero Export ===" > "$out" for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue echo "--- $(basename "$f" .log) ---" >> "$out" cat "$f" >> "$out" echo "" >> "$out" done ;; *) echo "Formats: json, csv, txt"; return 1 ;; esac echo "Exported to $out ($(wc -c < "$out") bytes)" } _status() { echo "=== Habithero 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)" local last=$(tail -1 "$DATA_DIR/history.log" 2>/dev/null || echo "never") echo " Last activity: $last" echo " Status: OK" } _search() { local term="?Usage: habithero search <term>" echo "Searching for: $term" local found=0 for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local matches=$(grep -i "$term" "$f" 2>/dev/null || true) if [ -n "$matches" ]; then echo " --- $(basename "$f" .log) ---" echo "$matches" | while read -r line; do echo " $line" found=$((found + 1)) done fi done [ $found -eq 0 ] && echo " No matches found." } _recent() { echo "=== Recent Activity ===" if [ -f "$DATA_DIR/history.log" ]; then tail -20 "$DATA_DIR/history.log" | while IFS='' read -r line; do echo " $line" done else echo " No activity yet." fi } # Main dispatch case "-help" in add) shift if [ $# -eq 0 ]; then echo "Recent add entries:" tail -20 "$DATA_DIR/add.log" 2>/dev/null || echo " No entries yet. Use: habithero add <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/add.log" local total=$(wc -l < "$DATA_DIR/add.log") echo " [Habithero] add: $input" echo " Saved. Total add entries: $total" _log "add" "$input" fi ;; plan) shift if [ $# -eq 0 ]; then echo "Recent plan entries:" tail -20 "$DATA_DIR/plan.log" 2>/dev/null || echo " No entries yet. Use: habithero plan <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/plan.log" local total=$(wc -l < "$DATA_DIR/plan.log") echo " [Habithero] plan: $input" echo " Saved. Total plan entries: $total" _log "plan" "$input" fi ;; track) shift if [ $# -eq 0 ]; then echo "Recent track entries:" tail -20 "$DATA_DIR/track.log" 2>/dev/null || echo " No entries yet. Use: habithero track <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/track.log" local total=$(wc -l < "$DATA_DIR/track.log") echo " [Habithero] track: $input" echo " Saved. Total track entries: $total" _log "track" "$input" fi ;; review) shift if [ $# -eq 0 ]; then echo "Recent review entries:" tail -20 "$DATA_DIR/review.log" 2>/dev/null || echo " No entries yet. Use: habithero review <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/review.log" local total=$(wc -l < "$DATA_DIR/review.log") echo " [Habithero] review: $input" echo " Saved. Total review entries: $total" _log "review" "$input" fi ;; streak) shift if [ $# -eq 0 ]; then echo "Recent streak entries:" tail -20 "$DATA_DIR/streak.log" 2>/dev/null || echo " No entries yet. Use: habithero streak <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/streak.log" local total=$(wc -l < "$DATA_DIR/streak.log") echo " [Habithero] streak: $input" echo " Saved. Total streak entries: $total" _log "streak" "$input" fi ;; remind) shift if [ $# -eq 0 ]; then echo "Recent remind entries:" tail -20 "$DATA_DIR/remind.log" 2>/dev/null || echo " No entries yet. Use: habithero remind <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/remind.log" local total=$(wc -l < "$DATA_DIR/remind.log") echo " [Habithero] remind: $input" echo " Saved. Total remind entries: $total" _log "remind" "$input" fi ;; prioritize) shift if [ $# -eq 0 ]; then echo "Recent prioritize entries:" tail -20 "$DATA_DIR/prioritize.log" 2>/dev/null || echo " No entries yet. Use: habithero prioritize <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/prioritize.log" local total=$(wc -l < "$DATA_DIR/prioritize.log") echo " [Habithero] prioritize: $input" echo " Saved. Total prioritize entries: $total" _log "prioritize" "$input" fi ;; archive) shift if [ $# -eq 0 ]; then echo "Recent archive entries:" tail -20 "$DATA_DIR/archive.log" 2>/dev/null || echo " No entries yet. Use: habithero archive <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/archive.log" local total=$(wc -l < "$DATA_DIR/archive.log") echo " [Habithero] archive: $input" echo " Saved. Total archive entries: $total" _log "archive" "$input" fi ;; tag) shift if [ $# -eq 0 ]; then echo "Recent tag entries:" tail -20 "$DATA_DIR/tag.log" 2>/dev/null || echo " No entries yet. Use: habithero tag <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/tag.log" local total=$(wc -l < "$DATA_DIR/tag.log") echo " [Habithero] tag: $input" echo " Saved. Total tag entries: $total" _log "tag" "$input" fi ;; timeline) shift if [ $# -eq 0 ]; then echo "Recent timeline entries:" tail -20 "$DATA_DIR/timeline.log" 2>/dev/null || echo " No entries yet. Use: habithero timeline <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/timeline.log" local total=$(wc -l < "$DATA_DIR/timeline.log") echo " [Habithero] timeline: $input" echo " Saved. Total timeline entries: $total" _log "timeline" "$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: habithero 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 " [Habithero] report: $input" echo " Saved. Total report entries: $total" _log "report" "$input" fi ;; weekly-review) shift if [ $# -eq 0 ]; then echo "Recent weekly-review entries:" tail -20 "$DATA_DIR/weekly-review.log" 2>/dev/null || echo " No entries yet. Use: habithero weekly-review <input>" else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/weekly-review.log" local total=$(wc -l < "$DATA_DIR/weekly-review.log") echo " [Habithero] weekly-review: $input" echo " Saved. Total weekly-review entries: $total" _log "weekly-review" "$input" fi ;; stats) _stats ;; export) shift; _export "$@" ;; search) shift; _search "$@" ;; recent) _recent ;; status) _status ;; help|--help|-h) _help ;; version|--version|-v) _version ;; *) echo "Unknown command: $1" echo "Run 'habithero help' for available commands." exit 1 ;; esac
Create and visualize mind maps in the terminal with branching and export. Use when brainstorming ideas, organizing thoughts, exporting mind map structures.
--- name: MindMap description: "Create and visualize mind maps in the terminal with branching and export. Use when brainstorming ideas, organizing thoughts, exporting mind map structures." version: "2.0.0" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["mindmap","brainstorm","ideas","organize","thinking","productivity"] --- # MindMap Multi-purpose utility tool for managing structured data entries. Add, list, search, remove, and export data items — all stored locally in a simple log-based format with full history tracking. ## Commands All commands are invoked via `mindmap <command> [args]`. | Command | Description | |---------|-------------| | `run <args>` | Execute the main function — logs and confirms execution | | `config` | Show the configuration file path (`$DATA_DIR/config.json`) | | `status` | Show current status (reports "ready") | | `init` | Initialize the data directory (creates `$DATA_DIR` if needed) | | `list` | List all data entries from the data log | | `add <text>` | Add a new dated entry to the data log | | `remove <item>` | Remove an entry (logs the removal) | | `search <term>` | Search the data log for a keyword (case-insensitive via `grep -i`) | | `export` | Export all data from the data log to stdout | | `info` | Show version and data directory path | | `help` | Show the built-in help message | | `version` | Print version string (`mindmap v2.0.0`) | ## Data Storage - **Location:** `~/.local/share/mindmap/` (override with `MINDMAP_DIR` environment variable, or `XDG_DATA_HOME`) - **Data log:** `data.log` — stores all entries added via `add`, one per line, prefixed with `YYYY-MM-DD` - **History:** `history.log` — every command execution is recorded with a timestamp for auditing - **Format:** Plain text, one entry per line ## Requirements - Bash 4+ - Standard Unix utilities (`date`, `grep`, `cat`, `basename`) - No external dependencies, no API keys, no network access needed ## When to Use 1. **Quick note-taking** — Use `mindmap add` to jot down ideas, tasks, or observations from the terminal without leaving your workflow 2. **Data collection** — Accumulate structured entries over time (e.g. daily logs, observations, measurements) and export them for analysis 3. **Search and retrieval** — Use `mindmap search` to quickly find entries matching a keyword across your entire data log 4. **Automation pipelines** — Integrate `mindmap add` and `mindmap export` into shell scripts or cron jobs for automated data collection and reporting 5. **Lightweight project tracking** — Track items, remove completed ones, and list remaining work — all from the command line without heavyweight tools ## Examples ```bash # Initialize the data directory mindmap init # Add a new entry mindmap add "Brainstorm: redesign landing page layout" # Add another entry mindmap add "TODO: review pull request #42" # List all entries mindmap list # Search for entries containing "redesign" mindmap search "redesign" # Export all data to a file mindmap export > backup.txt # Check status mindmap status # Show version and data path mindmap info # Run a custom operation mindmap run "process weekly report" ``` ## Output All command output goes to stdout. Redirect to save: ```bash mindmap list > all-entries.txt mindmap export > export-backup.txt ``` ## Configuration Set the `MINDMAP_DIR` environment variable to change the data directory: ```bash export MINDMAP_DIR="$HOME/my-mindmap-data" mindmap init ``` Default location: `~/.local/share/mindmap/` --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash # mindmap - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/mindmap}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF mindmap v$VERSION Multi-purpose utility tool Usage: mindmap <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "mindmap v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac
Manage recipes and grocery lists with ingredient tracking and meal plans. Use when adding recipes, searching by ingredient, or building shopping lists.
--- version: "2.0.0" name: cooking-recipe description: "Manage recipes and grocery lists with ingredient tracking and meal plans. Use when adding recipes, searching by ingredient, or building shopping lists." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # ChefPad — Recipe Manager A local-first recipe management tool. Add recipes with cuisine and cooking time, build ingredient lists and step-by-step instructions, rate your favorites, search by keyword or ingredient, and get random meal suggestions — all from the command line. ## Commands | Command | Description | |---------|-------------| | `chefpad add <name> [cuisine] [mins]` | Add a new recipe with optional cuisine type and cooking time (default: general, 30min) | | `chefpad ingredient <id> <text>` | Add an ingredient to an existing recipe by its ID | | `chefpad step <id> <text>` | Add a cooking step to an existing recipe by its ID | | `chefpad list` | List all saved recipes with ratings, ingredient and step counts | | `chefpad show <id>` | Show full recipe details — ingredients, steps, cuisine, time, rating | | `chefpad search <keyword>` | Search recipes by name, cuisine, or ingredient | | `chefpad rate <id> <1-5>` | Rate a recipe from 1 to 5 stars | | `chefpad random` | Get a random recipe suggestion from your collection | | `chefpad suggest <ingredients...>` | Find recipes that match the ingredients you have on hand | | `chefpad info` | Show version and branding info | | `chefpad help` | Show all available commands | ## Data Storage - **Location:** `~/.chefpad/` - `recipes.json` — Stores all recipes with their ingredients, steps, ratings, cuisine, and cooking time - `favorites.json` — Reserved for favorite recipe tracking - Both files are auto-created as empty JSON arrays on first run - All data is stored locally as JSON — no external APIs, no network calls, no accounts needed ## Requirements - bash (any modern version) - python3 (standard library only — uses `json`, `time`, `random`) - No external dependencies or API keys required ## When to Use 1. **Building a personal recipe collection** — Add recipes you discover or create, complete with ingredients and step-by-step instructions, all stored locally. 2. **Meal planning with what you have** — Use `suggest` with ingredients in your fridge to find matching recipes from your collection. 3. **Quick dinner decisions** — Use `random` when you can't decide what to cook and want a surprise pick from your saved recipes. 4. **Searching by cuisine or ingredient** — Quickly find all Italian recipes or everything that uses chicken with the `search` command. 5. **Rating and tracking favorites** — Rate recipes after cooking them to build a curated list of your best dishes over time. ## Examples ```bash # Add a new recipe chefpad add "Kung Pao Chicken" chinese 25 # Add ingredients to the recipe (use the ID shown after adding) chefpad ingredient 1710000000 "500g chicken breast, diced" chefpad ingredient 1710000000 "100g roasted peanuts" chefpad ingredient 1710000000 "3 dried chili peppers" chefpad ingredient 1710000000 "2 tbsp soy sauce" # Add cooking steps chefpad step 1710000000 "Marinate chicken with soy sauce for 15 minutes" chefpad step 1710000000 "Stir-fry chicken until golden, set aside" chefpad step 1710000000 "Fry chili peppers, add chicken and peanuts, toss" # List all your recipes chefpad list # Show full recipe details chefpad show 1710000000 # Rate a recipe chefpad rate 1710000000 5 # Search for chicken recipes chefpad search chicken # Find recipes matching ingredients you have chefpad suggest chicken peanuts # Get a random meal suggestion chefpad random ``` --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:_meta.json { "ownerId": "kn7e60c0zbzfa33m5mqvwzbx1s82jnx1", "slug": "cooking-recipe", "version": "1.0.0", "publishedAt": 1773055614388 } FILE:scripts/script.sh #!/bin/bash # ChefPad - 食谱管理器 # Powered by BytesAgain | bytesagain.com DATA_DIR="$HOME/.chefpad" RECIPES_FILE="$DATA_DIR/recipes.json" FAVORITES_FILE="$DATA_DIR/favorites.json" mkdir -p "$DATA_DIR" [ ! -f "$RECIPES_FILE" ] && echo "[]" > "$RECIPES_FILE" [ ! -f "$FAVORITES_FILE" ] && echo "[]" > "$FAVORITES_FILE" cmd_add() { local name="$1"; shift local cuisine="-general"; shift local time_mins="-30" if [ -z "$name" ]; then echo "Usage: chefpad add <name> [cuisine] [time_minutes]" return 1 fi python3 << PYEOF import json, time as t recipe = {"id": int(t.time()), "name": "$name", "cuisine": "$cuisine", "time": int("$time_mins"), "ingredients": [], "steps": [], "rating": 0, "created": t.strftime("%Y-%m-%d")} try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] data.append(recipe) with open("$RECIPES_FILE", "w") as f: json.dump(data, f, indent=2) print("Recipe added: {} ({}, {}min)".format("$name", "$cuisine", "$time_mins")) PYEOF } cmd_ingredient() { local recipe_id="$1"; shift local ingredient="$*" if [ -z "$recipe_id" ] || [ -z "$ingredient" ]; then echo "Usage: chefpad ingredient <recipe_id> <ingredient>" return 1 fi python3 << PYEOF import json try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] for r in data: if str(r["id"]) == "$recipe_id": r.setdefault("ingredients",[]).append("$ingredient") print("Added ingredient: $ingredient") break with open("$RECIPES_FILE", "w") as f: json.dump(data, f, indent=2) PYEOF } cmd_step() { local recipe_id="$1"; shift local step="$*" if [ -z "$recipe_id" ] || [ -z "$step" ]; then echo "Usage: chefpad step <recipe_id> <step_description>" return 1 fi python3 << PYEOF import json try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] for r in data: if str(r["id"]) == "$recipe_id": r.setdefault("steps",[]).append("$step") print("Step {} added".format(len(r["steps"]))) break with open("$RECIPES_FILE", "w") as f: json.dump(data, f, indent=2) PYEOF } cmd_list() { python3 << PYEOF import json try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] if not data: print("No recipes yet. Add one: chefpad add <name>") else: print("Your Recipes:") print("-" * 50) for r in data: stars = "⭐" * r.get("rating",0) if r.get("rating",0) > 0 else "(unrated)" print(" [{}] {} - {} ({}min) {}".format(r["id"], r["name"], r["cuisine"], r["time"], stars)) print(" Ingredients: {} | Steps: {}".format(len(r.get("ingredients",[])), len(r.get("steps",[])))) PYEOF } cmd_show() { local recipe_id="$1" if [ -z "$recipe_id" ]; then echo "Usage: chefpad show <recipe_id>" return 1 fi python3 << PYEOF import json try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] for r in data: if str(r["id"]) == "$recipe_id": print("=== {} ===".format(r["name"])) print("Cuisine: {} | Time: {}min".format(r["cuisine"], r["time"])) stars = "⭐" * r.get("rating",0) if r.get("rating",0) > 0 else "(unrated)" print("Rating: {}".format(stars)) print("\nIngredients:") for i, ing in enumerate(r.get("ingredients",[]), 1): print(" {}. {}".format(i, ing)) print("\nSteps:") for i, s in enumerate(r.get("steps",[]), 1): print(" {}. {}".format(i, s)) break else: print("Recipe not found: $recipe_id") PYEOF } cmd_search() { local query="$*" if [ -z "$query" ]; then echo "Usage: chefpad search <keyword>" return 1 fi python3 << PYEOF import json try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] q = "$query".lower() results = [r for r in data if q in r["name"].lower() or q in r["cuisine"].lower() or any(q in i.lower() for i in r.get("ingredients",[]))] if not results: print("No recipes found for: $query") else: print("Found {} recipe(s):".format(len(results))) for r in results: print(" [{}] {} ({}, {}min)".format(r["id"], r["name"], r["cuisine"], r["time"])) PYEOF } cmd_rate() { local recipe_id="$1" local rating="$2" if [ -z "$recipe_id" ] || [ -z "$rating" ]; then echo "Usage: chefpad rate <recipe_id> <1-5>" return 1 fi if ! [[ "$rating" =~ ^[1-5]$ ]]; then echo "Rating must be 1-5" return 1 fi python3 << PYEOF import json try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] for r in data: if str(r["id"]) == "$recipe_id": r["rating"] = int("$rating") print("Rated {} as {}".format(r["name"], "⭐" * int("$rating"))) break with open("$RECIPES_FILE", "w") as f: json.dump(data, f, indent=2) PYEOF } cmd_random() { python3 << PYEOF import json, random try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] if not data: print("No recipes yet!") else: r = random.choice(data) print("How about: {} ({}, {}min)?".format(r["name"], r["cuisine"], r["time"])) PYEOF } cmd_suggest() { local ingredients="$*" if [ -z "$ingredients" ]; then echo "Usage: chefpad suggest <ingredient1> <ingredient2> ..." return 1 fi python3 << PYEOF import json try: with open("$RECIPES_FILE") as f: data = json.load(f) except: data = [] query_ings = "$ingredients".lower().split() results = [] for r in data: recipe_ings = " ".join(r.get("ingredients",[])).lower() matches = sum(1 for q in query_ings if q in recipe_ings) if matches > 0: results.append((matches, r)) results.sort(key=lambda x: -x[0]) if not results: print("No matching recipes. Try adding more recipes first!") else: print("Recipes matching your ingredients:") for score, r in results[:5]: print(" [{}] {} ({} ingredient match)".format(r["id"], r["name"], score)) PYEOF } cmd_info() { echo "ChefPad v1.0.0" echo "Powered by BytesAgain | bytesagain.com" } cmd_help() { echo "ChefPad - Recipe Manager" echo "Usage: chefpad <command> [arguments]" echo "" echo "Commands:" echo " add <name> [cuisine] [mins] Add a recipe" echo " ingredient <id> <text> Add ingredient to recipe" echo " step <id> <text> Add cooking step" echo " list List all recipes" echo " show <id> Show recipe details" echo " search <keyword> Search recipes" echo " rate <id> <1-5> Rate a recipe" echo " random Get random recipe suggestion" echo " suggest <ingredients...> Find recipes by ingredients" echo " info Version info" echo " help Show this help" } case "$1" in add) shift; cmd_add "$@";; ingredient) shift; cmd_ingredient "$@";; step) shift; cmd_step "$@";; list) cmd_list;; show) shift; cmd_show "$@";; search) shift; cmd_search "$@";; rate) shift; cmd_rate "$@";; random) cmd_random;; suggest) shift; cmd_suggest "$@";; info) cmd_info;; help|"") cmd_help;; *) echo "Unknown command: $1"; cmd_help; exit 1;; esac
Plan events with budgets, guest lists, and timelines. Use when organizing weddings, coordinating birthdays, managing vendors, drafting invitations.
---
version: "2.0.0"
name: Event Planner
description: "Plan events with budgets, guest lists, and timelines. Use when organizing weddings, coordinating birthdays, managing vendors, drafting invitations."
author: BytesAgain
homepage: https://bytesagain.com
source: https://github.com/bytesagain/ai-skills
---
# PartyCraft — 活动策划助手
PartyCraft is a full-featured event planning assistant that runs entirely from the command line. Create events (weddings, birthdays, corporate gatherings, parties), manage budgets, track tasks with completion status, maintain guest lists with RSVP tracking, view countdown timelines, and generate suggested checklists by event type. All data is stored locally in JSON format.
## Commands
| Command | Description |
|---------|-------------|
| `partycraft create <name> <date> [type]` | Create a new event. Types: `wedding`, `birthday`, `corporate`, `party`, `general` (default) |
| `partycraft list` | List all events with task progress, guest count, and budget |
| `partycraft budget <event_id> <amount>` | Set or update the budget for an event |
| `partycraft task <event_id> add <text>` | Add a task to an event |
| `partycraft task <event_id> done <number>` | Mark a task as complete by its number |
| `partycraft task <event_id> list` | List all tasks for an event with ✅/⬜ status |
| `partycraft guest <event_id> add <name>` | Add a guest to an event |
| `partycraft guest <event_id> list` | List all guests with RSVP status |
| `partycraft timeline <event_id>` | Show countdown, task progress, and guest count for an event |
| `partycraft checklist [type]` | Show a suggested checklist for an event type (wedding/birthday/corporate/general) |
| `partycraft info` | Show version information |
| `partycraft help` | Show usage help |
## Data Storage
All data is stored locally in `~/.partycraft/`:
- **`events.json`** — Main data file containing all events as a JSON array. Each event object includes:
- `id` — Unix timestamp at creation (unique identifier)
- `name` — Event name
- `date` — Event date in `YYYY-MM-DD` format
- `type` — Event type (wedding/birthday/corporate/party/general)
- `budget` — Budget amount (numeric)
- `tasks` — Array of `{text, done}` objects
- `guests` — Array of `{name, rsvp}` objects
- `created` — Creation date
The directory is created automatically on first run. The `events.json` file is initialized as an empty array `[]` if it doesn't exist.
## Requirements
- **bash** (any modern version)
- **python3** (standard library only — uses `json`, `time`, `datetime`)
- No API keys, no network access, no external dependencies
## When to Use
1. **Planning a wedding** — Create the event, use `checklist wedding` for a suggested task list (venue, catering, photographer, flowers, seating, music, cake, rehearsal dinner), add tasks, track guest RSVPs, and set the budget.
2. **Organizing a birthday party** — Create a birthday event, get a suggested checklist (theme, invitations, cake, decorations, games, food, party favors), add and track tasks as you complete them.
3. **Managing a corporate event** — Create a corporate event with objectives, agenda, AV equipment, catering, and name badges tracked as tasks. Monitor completion with `task list`.
4. **Tracking event countdown** — Use `timeline <id>` to see how many days remain, get warnings when less than a week out (⚠️), and monitor task completion percentage.
5. **Managing guest lists** — Add guests with `guest <id> add <name>`, view the full list with RSVP status, and track headcount alongside budget and task progress in `list`.
## Examples
```bash
# Create a wedding event
partycraft create "Alice & Bob Wedding" 2025-06-15 wedding
# Event created: Alice & Bob Wedding (wedding) on 2025-06-15
# List all events with progress summary
partycraft list
# Your Events:
# --------------------------------------------------
# [1710500000] Alice & Bob Wedding - 2025-06-15 (wedding)
# Tasks: 0/0 | Guests: 0 | Budget: $0
# Set the budget
partycraft budget 1710500000 50000
# Budget set to $50000 for: Alice & Bob Wedding
# Add tasks
partycraft task 1710500000 add "Book venue"
# Task added: Book venue
partycraft task 1710500000 add "Send invitations"
# Task added: Send invitations
# Mark a task as done
partycraft task 1710500000 done 1
# Task completed: Book venue
# View tasks with status
partycraft task 1710500000 list
# ✅ 1. Book venue
# ⬜ 2. Send invitations
# Add guests
partycraft guest 1710500000 add "Charlie"
# Guest added: Charlie
# View the timeline countdown
partycraft timeline 1710500000
# Timeline for: Alice & Bob Wedding (2025-06-15)
# ----------------------------------------
# 89 days until event
# Tasks: 1/2 complete
# Guests: 1 invited
# 📋 One month out. Confirm details.
# Get a suggested checklist for a birthday party
partycraft checklist birthday
# Suggested Checklist for: birthday
# □ Choose theme
# □ Send invitations
# □ Order cake
# □ Buy decorations
# □ Plan activities/games
# □ Arrange food/drinks
# □ Party favors
```
## Checklist Templates
PartyCraft includes built-in checklist templates for common event types:
- **Wedding** — Venue, invitations, catering, photographer, flowers, seating, music/DJ, cake, rehearsal dinner, final guest count
- **Birthday** — Theme, invitations, cake, decorations, activities/games, food/drinks, party favors
- **Corporate** — Objectives, venue, invitations, AV equipment, agenda/speakers, catering, name badges, follow-up materials
- **General** — Date/time, venue, guest list, invitations, food/drinks, decorations, entertainment, cleanup plan
## Output
All output is printed to stdout. Event data is persisted in `~/.partycraft/events.json` and can be viewed or edited directly.
---
*Powered by BytesAgain | bytesagain.com | [email protected]*
FILE:scripts/script.sh
#!/bin/bash
# PartyCraft - 活动策划助手
# Powered by BytesAgain | bytesagain.com
DATA_DIR="$HOME/.partycraft"
EVENTS_FILE="$DATA_DIR/events.json"
mkdir -p "$DATA_DIR"
[ ! -f "$EVENTS_FILE" ] && echo "[]" > "$EVENTS_FILE"
cmd_create() {
local name="$1"; shift
local date="$1"; shift
local type="-general"
if [ -z "$name" ] || [ -z "$date" ]; then
echo "Usage: partycraft create <name> <date> [type]"
echo "Types: wedding, birthday, corporate, party, general"
return 1
fi
python3 << PYEOF
import json, time
event = {"id": int(time.time()), "name": "$name", "date": "$date", "type": "$type", "budget": 0, "tasks": [], "guests": [], "created": time.strftime("%Y-%m-%d")}
try:
with open("$EVENTS_FILE") as f: data = json.load(f)
except: data = []
data.append(event)
with open("$EVENTS_FILE", "w") as f: json.dump(data, f, indent=2)
print("Event created: {} ({}) on {}".format("$name", "$type", "$date"))
PYEOF
}
cmd_list() {
python3 << PYEOF
import json
try:
with open("$EVENTS_FILE") as f: data = json.load(f)
except: data = []
if not data:
print("No events. Create one: partycraft create <name> <date>")
else:
print("Your Events:")
print("-" * 50)
for e in data:
tasks_done = sum(1 for t in e.get("tasks",[]) if t.get("done"))
total_tasks = len(e.get("tasks",[]))
guests = len(e.get("guests",[]))
print(" [{}] {} - {} ({})".format(e["id"], e["name"], e["date"], e["type"]))
print(" Tasks: {}/{} | Guests: {} | Budget: \${}".format(tasks_done, total_tasks, guests, e.get("budget",0)))
PYEOF
}
cmd_budget() {
local event_id="$1"
local amount="$2"
if [ -z "$event_id" ] || [ -z "$amount" ]; then
echo "Usage: partycraft budget <event_id> <amount>"
return 1
fi
python3 << PYEOF
import json
try:
with open("$EVENTS_FILE") as f: data = json.load(f)
except: data = []
found = False
for e in data:
if str(e["id"]) == "$event_id":
e["budget"] = float("$amount")
found = True
print("Budget set to \${} for: {}".format("$amount", e["name"]))
break
if not found: print("Event not found: $event_id")
with open("$EVENTS_FILE", "w") as f: json.dump(data, f, indent=2)
PYEOF
}
cmd_task() {
local event_id="$1"; shift
local action="$1"; shift
local task_text="$*"
if [ -z "$event_id" ] || [ -z "$action" ]; then
echo "Usage: partycraft task <event_id> add <task_text>"
echo " partycraft task <event_id> done <task_number>"
echo " partycraft task <event_id> list"
return 1
fi
python3 << PYEOF
import json
try:
with open("$EVENTS_FILE") as f: data = json.load(f)
except: data = []
found = False
for e in data:
if str(e["id"]) == "$event_id":
found = True
if "$action" == "add":
e.setdefault("tasks",[]).append({"text": "$task_text", "done": False})
print("Task added: $task_text")
elif "$action" == "done":
idx = int("$task_text") - 1
if 0 <= idx < len(e.get("tasks",[])):
e["tasks"][idx]["done"] = True
print("Task completed: {}".format(e["tasks"][idx]["text"]))
else:
print("Invalid task number")
elif "$action" == "list":
tasks = e.get("tasks",[])
if not tasks: print("No tasks yet.")
else:
for i,t in enumerate(tasks,1):
status = "✅" if t["done"] else "⬜"
print(" {} {}. {}".format(status, i, t["text"]))
break
if not found: print("Event not found: $event_id")
with open("$EVENTS_FILE", "w") as f: json.dump(data, f, indent=2)
PYEOF
}
cmd_guest() {
local event_id="$1"; shift
local action="$1"; shift
local guest_name="$*"
if [ -z "$event_id" ] || [ -z "$action" ]; then
echo "Usage: partycraft guest <event_id> add <name>"
echo " partycraft guest <event_id> list"
return 1
fi
python3 << PYEOF
import json
try:
with open("$EVENTS_FILE") as f: data = json.load(f)
except: data = []
found = False
for e in data:
if str(e["id"]) == "$event_id":
found = True
if "$action" == "add":
e.setdefault("guests",[]).append({"name": "$guest_name", "rsvp": "pending"})
print("Guest added: $guest_name")
elif "$action" == "list":
guests = e.get("guests",[])
if not guests: print("No guests yet.")
else:
for g in guests:
print(" {} ({})".format(g["name"], g.get("rsvp","pending")))
break
if not found: print("Event not found: $event_id")
with open("$EVENTS_FILE", "w") as f: json.dump(data, f, indent=2)
PYEOF
}
cmd_timeline() {
local event_id="$1"
if [ -z "$event_id" ]; then
echo "Usage: partycraft timeline <event_id>"
return 1
fi
python3 << PYEOF
import json, datetime
try:
with open("$EVENTS_FILE") as f: data = json.load(f)
except: data = []
for e in data:
if str(e["id"]) == "$event_id":
try:
event_date = datetime.datetime.strptime(e["date"], "%Y-%m-%d").date()
today = datetime.date.today()
days_left = (event_date - today).days
print("Timeline for: {} ({})".format(e["name"], e["date"]))
print("-" * 40)
if days_left > 0:
print(" {} days until event".format(days_left))
tasks = e.get("tasks",[])
done = sum(1 for t in tasks if t["done"])
print(" Tasks: {}/{} complete".format(done, len(tasks)))
print(" Guests: {} invited".format(len(e.get("guests",[]))))
if days_left <= 7: print(" ⚠️ Less than a week! Final preparations!")
elif days_left <= 30: print(" 📋 One month out. Confirm details.")
elif days_left == 0:
print(" 🎉 Event is TODAY!")
else:
print(" Event was {} days ago".format(abs(days_left)))
except: print("Invalid date format. Use YYYY-MM-DD")
break
PYEOF
}
cmd_checklist() {
local event_type="-general"
echo "Suggested Checklist for: $event_type"
echo "-" * 40
case "$event_type" in
wedding)
echo " □ Book venue"
echo " □ Send invitations (3 months before)"
echo " □ Arrange catering"
echo " □ Book photographer"
echo " □ Order flowers"
echo " □ Plan seating"
echo " □ Arrange music/DJ"
echo " □ Wedding cake"
echo " □ Rehearsal dinner"
echo " □ Final guest count (1 week before)"
;;
birthday)
echo " □ Choose theme"
echo " □ Send invitations"
echo " □ Order cake"
echo " □ Buy decorations"
echo " □ Plan activities/games"
echo " □ Arrange food/drinks"
echo " □ Party favors"
;;
corporate)
echo " □ Define objectives"
echo " □ Book venue"
echo " □ Send invitations"
echo " □ Arrange AV equipment"
echo " □ Plan agenda/speakers"
echo " □ Catering"
echo " □ Name badges"
echo " □ Follow-up materials"
;;
*)
echo " □ Set date and time"
echo " □ Choose venue"
echo " □ Create guest list"
echo " □ Send invitations"
echo " □ Plan food and drinks"
echo " □ Decorations"
echo " □ Activities/entertainment"
echo " □ Clean up plan"
;;
esac
}
cmd_info() {
echo "PartyCraft v1.0.0"
echo "Powered by BytesAgain | bytesagain.com"
}
cmd_help() {
echo "PartyCraft - 活动策划助手"
echo "Usage: partycraft <command> [arguments]"
echo ""
echo "Commands:"
echo " create <name> <date> [type] Create event (types: wedding/birthday/corporate/party/general)"
echo " list List all events"
echo " budget <id> <amount> Set event budget"
echo " task <id> add <text> Add task to event"
echo " task <id> done <number> Mark task complete"
echo " task <id> list List event tasks"
echo " guest <id> add <name> Add guest"
echo " guest <id> list List guests"
echo " timeline <id> Show event timeline"
echo " checklist [type] Show suggested checklist"
echo " info Version info"
echo " help Show this help"
}
case "$1" in
create) shift; cmd_create "$@";;
list) cmd_list;;
budget) shift; cmd_budget "$@";;
task) shift; cmd_task "$@";;
guest) shift; cmd_guest "$@";;
timeline) shift; cmd_timeline "$@";;
checklist) shift; cmd_checklist "$@";;
info) cmd_info;;
help|"") cmd_help;;
*) echo "Unknown command: $1"; cmd_help; exit 1;;
esac
Reference tool for life — covers intro, quickstart, patterns and more. Quick lookup for Moodring concepts, best practices, and implementation patterns.
--- name: "moodring" version: "2.0.4" description: "Reference tool for life — covers intro, quickstart, patterns and more. Quick lookup for Moodring concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [moodring, reference] category: "life" --- # Moodring Reference tool for life — covers intro, quickstart, patterns and more. Quick lookup for Moodring 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 # moodring — Moodring reference tool. Use when working with moodring in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="2.0.3" show_help() { cat << 'HELPEOF' moodring v$VERSION — Moodring Reference Tool Usage: moodring <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' # Moodring — Overview ## What is Moodring? Moodring (moodring) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with moodring. ## Key Concepts - Core moodring principles and fundamentals - How moodring fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Moodring Matters Understanding moodring 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 moodring concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Moodring — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the moodring 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' # Moodring — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for moodring 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' # Moodring — 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' # Moodring — 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' # Moodring — 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' # Moodring — 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' # Moodring — 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 "moodring v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: moodring help"; exit 1 ;; esac
An AI agent development platform with all-in-one visual tools, simplifying agent creation, debugging coze studio, typescript, agent, agent-platform.
--- version: "2.0.0" name: Coze Studio description: "An AI agent development platform with all-in-one visual tools, simplifying agent creation, debugging coze studio, typescript, agent, agent-platform." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Coze Studio An AI agent development platform with all-in-one visual tools, simplifying agent creation, debugging, and deployment like never before. Coze your way to AI Agent creation. ## Commands - `help` - Help - `run` - Run - `info` - Info - `status` - Status ## Features - Core functionality from coze-dev/coze-studio ## Usage Run any command: `coze-studio <command> [args]` --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help coze-studio help # Run coze-studio run ``` - Run `coze-studio help` for all commands - Run `coze-studio help` for all commands ## Configuration Set `COZE_STUDIO_DIR` to change data directory. Default: `~/.local/share/coze-studio/` FILE:scripts/coze_studio.sh #!/usr/bin/env bash # Coze Studio - inspired by coze-dev/coze-studio set -euo pipefail CMD="-help" shift 2>/dev/null || true case "$CMD" in help) echo "Coze Studio" echo "" echo "Commands:" echo " help Help" echo " run Run" echo " info Info" echo " status Status" echo "" echo "Powered by BytesAgain | bytesagain.com" ;; info) echo "Coze Studio v1.0.0" echo "Based on: https://github.com/coze-dev/coze-studio" echo "Stars: 20,131+" ;; run) echo "TODO: Implement main functionality" ;; status) echo "Status: ready" ;; *) echo "Unknown: $CMD" echo "Run 'coze-studio help' for usage" exit 1 ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # coze-studio - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/coze-studio}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF coze-studio v$VERSION Multi-purpose utility tool Usage: coze-studio <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "coze-studio v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Tips for Coze Studio ## Quick Start 1. Run `coze-studio help` to see available commands 2. Most commands output to stdout or generate files ## Source Based on [coze-dev/coze-studio](https://github.com/coze-dev/coze-studio) - 20,131+ GitHub stars, Language: TypeScript, License: Apache-2.0
Personal bookkeeping assistant for local income and expense tracking, monthly reports with comparisons, budget alerts, and savings goal management.
--- version: "2.0.0" name: Bookkeeping description: "记账管家。收支记录、月度报表(含同比环比)、预算管理、存钱目标追踪。数据存本地JSON。. Use when you need beancount capabilities. Triggers on: beancount." 记账理财助手。个人收支记录、月度报表、预算管理、消费分析、储蓄目标。Personal bookkeeping with income/expense tracking, monthly reports, budget management. 记账本、家庭账本、理财规划。Use when tracking personal finances. author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # bookkeeping 记账管家。收支记录、月度报表(含同比环比)、预算管理、存钱目标追踪。数据存本地JSON。 ## Commands All commands via `scripts/book.sh`: | Command | Usage | Description | |---------|-------|-------------| | `add` | `book.sh add "金额" "类别" "备注" [--type income\|expense]` | 记一笔账(默认expense) | | `list` | `book.sh list [--month 2026-03]` | 查看记录(默认当月) | | `report` | `book.sh report [--month 2026-03]` | 月度收支报表(含同比环比+分类饼图+支出TOP3) | | `budget` | `book.sh budget "类别" "月预算"` | 设置类别月预算(超支自动提醒) | | `goal` | `book.sh goal "目标名" "金额" "月数"` | 设置存钱目标(计算每月需存) | | `goal-save` | `book.sh goal-save "目标名" "金额"` | 往目标里存钱 | | `goals` | `book.sh goals` | 查看所有存钱目标进度 | | `help` | `book.sh help` | 显示帮助信息 | ## Data Storage - 记录文件: `~/.bookkeeping/records.json` - 预算文件: `~/.bookkeeping/budgets.json` - 目标文件: `~/.bookkeeping/goals.json` - 自动创建目录和文件 ## Examples ```bash # 记一笔支出 bash scripts/book.sh add 35.5 餐饮 "午餐外卖" # 记一笔收入 bash scripts/book.sh add 15000 工资 "3月工资" --type income # 查看当月记录 bash scripts/book.sh list # 查看指定月份 bash scripts/book.sh list --month 2026-02 # 生成月度报表(含同比环比) bash scripts/book.sh report # 设置餐饮预算 bash scripts/book.sh budget 餐饮 2000 # 设置存钱目标(6个月存8000) bash scripts/book.sh goal "买相机" 8000 6 # 往目标存钱 bash scripts/book.sh goal-save "买相机" 1500 # 查看所有目标进度 bash scripts/book.sh goals ``` ## Categories (建议) - 支出: 餐饮、交通、购物、娱乐、居住、医疗、教育、其他 - 收入: 工资、奖金、理财、兼职、其他 ## Reference - 参考文档: `tips.md` — 记账理财小贴士(50-30-20法则、存钱技巧等) ## Notes - 数据存储在 `~/.bookkeeping/` 目录 - JSON 格式,可手动编辑 - 纯本地运行,无需联网 - Python 3.6+ 兼容 --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com FILE:scripts/book.sh #!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" CMD="-help" python3 - "$@" << 'PYTHON_SCRIPT' import sys import os import json import datetime DATA_DIR = os.path.expanduser("~/.bookkeeping") RECORDS_FILE = os.path.join(DATA_DIR, "records.json") BUDGETS_FILE = os.path.join(DATA_DIR, "budgets.json") def ensure_data_dir(): if not os.path.exists(DATA_DIR): os.makedirs(DATA_DIR) def load_records(): ensure_data_dir() if os.path.exists(RECORDS_FILE): with open(RECORDS_FILE, 'r') as f: return json.load(f) return [] def save_records(records): ensure_data_dir() with open(RECORDS_FILE, 'w') as f: json.dump(records, f, ensure_ascii=False, indent=2) def load_budgets(): ensure_data_dir() if os.path.exists(BUDGETS_FILE): with open(BUDGETS_FILE, 'r') as f: return json.load(f) return {} def save_budgets(budgets): ensure_data_dir() with open(BUDGETS_FILE, 'w') as f: json.dump(budgets, f, ensure_ascii=False, indent=2) def fmt_money(v): return "{:,.2f}".format(v) def get_current_month(): return datetime.date.today().strftime("%Y-%m") def add_record(amount, category, note, record_type): records = load_records() now = datetime.datetime.now() record = { 'id': len(records) + 1, 'date': now.strftime("%Y-%m-%d"), 'time': now.strftime("%H:%M:%S"), 'type': record_type, 'amount': round(float(amount), 2), 'category': category, 'note': note, } records.append(record) save_records(records) emoji = "💰" if record_type == "income" else "💸" type_label = "收入" if record_type == "income" else "支出" print("") print("{} 记账成功!".format(emoji)) print("─" * 35) print(" 类型: {}".format(type_label)) print(" 金额: {} 元".format(fmt_money(record['amount']))) print(" 类别: {}".format(category)) print(" 备注: {}".format(note)) print(" 日期: {} {}".format(record['date'], record['time'])) print(" 编号: #{}".format(record['id'])) print("") def list_records(month): records = load_records() filtered = [r for r in records if r['date'].startswith(month)] if not filtered: print("") print("📋 {} 暂无记录".format(month)) print("") return print("") print("📋 {} 收支记录".format(month)) print("─" * 55) print(" {:<4s} {:<12s} {:<6s} {:<10s} {:<8s} {}".format( "编号", "日期", "类型", "金额", "类别", "备注")) print(" " + "─" * 52) total_income = 0 total_expense = 0 for r in filtered: type_label = "收入" if r['type'] == 'income' else "支出" emoji = "+" if r['type'] == 'income' else "-" print(" {:<4s} {:<12s} {:<6s} {}{:<9s} {:<8s} {}".format( "#{}".format(r['id']), r['date'], type_label, emoji, fmt_money(r['amount']), r['category'], r.get('note', '') )) if r['type'] == 'income': total_income += r['amount'] else: total_expense += r['amount'] print(" " + "─" * 52) print(" 共 {} 条记录 | 收入: {} | 支出: {} | 结余: {}".format( len(filtered), fmt_money(total_income), fmt_money(total_expense), fmt_money(total_income - total_expense) )) print("") def report(month): records = load_records() budgets = load_budgets() filtered = [r for r in records if r['date'].startswith(month)] if not filtered: print("") print("📊 {} 暂无记录,无法生成报表".format(month)) print("") return total_income = 0 total_expense = 0 income_by_cat = {} expense_by_cat = {} for r in filtered: if r['type'] == 'income': total_income += r['amount'] cat = r['category'] income_by_cat[cat] = income_by_cat.get(cat, 0) + r['amount'] else: total_expense += r['amount'] cat = r['category'] expense_by_cat[cat] = expense_by_cat.get(cat, 0) + r['amount'] balance = total_income - total_expense print("") print("📊 {} 月度收支报表".format(month)) print("=" * 45) print("") print(" 💰 总收入: {} 元".format(fmt_money(total_income))) print(" 💸 总支出: {} 元".format(fmt_money(total_expense))) emoji = "📈" if balance >= 0 else "📉" print(" {} 结余: {} 元".format(emoji, fmt_money(balance))) if total_income > 0: save_rate = (balance / total_income) * 100 print(" 💹 储蓄率: {:.1f}%".format(save_rate)) print("") if income_by_cat: print(" 📥 收入明细:") sorted_income = sorted(income_by_cat.items(), key=lambda x: x[1], reverse=True) for cat, amount in sorted_income: pct = amount / total_income * 100 if total_income > 0 else 0 bar_len = int(pct / 5) bar = "█" * bar_len print(" {:<8s} {:>10s} ({:>5.1f}%) {}".format(cat, fmt_money(amount), pct, bar)) print("") if expense_by_cat: print(" 📤 支出明细:") sorted_expense = sorted(expense_by_cat.items(), key=lambda x: x[1], reverse=True) for cat, amount in sorted_expense: pct = amount / total_expense * 100 if total_expense > 0 else 0 bar_len = int(pct / 5) bar = "█" * bar_len budget_info = "" if cat in budgets: budget_val = budgets[cat] if amount > budget_val: budget_info = " ⚠️ 超预算 {}".format(fmt_money(amount - budget_val)) else: budget_info = " ✅ 预算内 (剩{})".format(fmt_money(budget_val - amount)) print(" {:<8s} {:>10s} ({:>5.1f}%) {}{}".format( cat, fmt_money(amount), pct, bar, budget_info)) print("") # 日均统计 days_in_month = set(r['date'] for r in filtered) num_days = len(days_in_month) if num_days > 0: print(" 📅 统计:") print(" 记录天数: {} 天".format(num_days)) print(" 日均支出: {} 元".format(fmt_money(total_expense / num_days))) if total_income > 0: print(" 日均收入: {} 元".format(fmt_money(total_income / num_days))) print("") def set_budget(category, amount): budgets = load_budgets() budgets[category] = round(float(amount), 2) save_budgets(budgets) print("") print("✅ 预算设置成功!") print("─" * 35) print(" 类别: {}".format(category)) print(" 月预算: {} 元".format(fmt_money(float(amount)))) print("") # 显示当月该类别已花费 month = get_current_month() records = load_records() spent = sum(r['amount'] for r in records if r['date'].startswith(month) and r['category'] == category and r['type'] == 'expense') if spent > 0: remaining = float(amount) - spent print(" 📊 本月已花费: {} 元".format(fmt_money(spent))) if remaining >= 0: print(" 💰 预算剩余: {} 元".format(fmt_money(remaining))) else: print(" ⚠️ 已超预算: {} 元".format(fmt_money(abs(remaining)))) print("") def load_goals(): ensure_data_dir() goals_file = os.path.join(DATA_DIR, "goals.json") if os.path.exists(goals_file): with open(goals_file, 'r') as f: return json.load(f) return [] def save_goals(goals): ensure_data_dir() goals_file = os.path.join(DATA_DIR, "goals.json") with open(goals_file, 'w') as f: json.dump(goals, f, ensure_ascii=False, indent=2) def get_prev_month(month_str): """获取上一个月 YYYY-MM""" parts = month_str.split('-') y = int(parts[0]) m = int(parts[1]) m -= 1 if m == 0: m = 12 y -= 1 return "{}-{:02d}".format(y, m) def get_same_month_last_year(month_str): """获取去年同月 YYYY-MM""" parts = month_str.split('-') y = int(parts[0]) - 1 m = int(parts[1]) return "{}-{:02d}".format(y, m) def enhanced_report(month): """增强版月度报表:含同比环比""" records = load_records() budgets = load_budgets() filtered = [r for r in records if r['date'].startswith(month)] if not filtered: print("") print("📊 {} 暂无记录,无法生成报表".format(month)) print("") return total_income = 0 total_expense = 0 income_by_cat = {} expense_by_cat = {} for r in filtered: if r['type'] == 'income': total_income += r['amount'] cat = r['category'] income_by_cat[cat] = income_by_cat.get(cat, 0) + r['amount'] else: total_expense += r['amount'] cat = r['category'] expense_by_cat[cat] = expense_by_cat.get(cat, 0) + r['amount'] balance = total_income - total_expense print("") print("📊 {} 月度收支报表".format(month)) print("=" * 50) print("") print(" 💰 总收入: {} 元".format(fmt_money(total_income))) print(" 💸 总支出: {} 元".format(fmt_money(total_expense))) emoji = "📈" if balance >= 0 else "📉" print(" {} 结余: {} 元".format(emoji, fmt_money(balance))) if total_income > 0: save_rate = (balance / total_income) * 100 print(" 💹 储蓄率: {:.1f}%".format(save_rate)) print("") # === 同比环比分析 === prev_month = get_prev_month(month) yoy_month = get_same_month_last_year(month) prev_records = [r for r in records if r['date'].startswith(prev_month)] yoy_records = [r for r in records if r['date'].startswith(yoy_month)] prev_expense = sum(r['amount'] for r in prev_records if r['type'] == 'expense') prev_income = sum(r['amount'] for r in prev_records if r['type'] == 'income') yoy_expense = sum(r['amount'] for r in yoy_records if r['type'] == 'expense') yoy_income = sum(r['amount'] for r in yoy_records if r['type'] == 'income') has_comparison = prev_expense > 0 or yoy_expense > 0 if has_comparison: print(" 📊 同比环比分析:") if prev_expense > 0: mom_pct = (total_expense - prev_expense) / prev_expense * 100 arrow = "↑" if mom_pct > 0 else "↓" print(" 环比(vs {}): 支出{} {:.1f}%".format(prev_month, arrow, abs(mom_pct))) if prev_income > 0: mom_inc_pct = (total_income - prev_income) / prev_income * 100 arrow = "↑" if mom_inc_pct > 0 else "↓" print(" 环比(vs {}): 收入{} {:.1f}%".format(prev_month, arrow, abs(mom_inc_pct))) if yoy_expense > 0: yoy_pct = (total_expense - yoy_expense) / yoy_expense * 100 arrow = "↑" if yoy_pct > 0 else "↓" print(" 同比(vs {}): 支出{} {:.1f}%".format(yoy_month, arrow, abs(yoy_pct))) if yoy_income > 0: yoy_inc_pct = (total_income - yoy_income) / yoy_income * 100 arrow = "↑" if yoy_inc_pct > 0 else "↓" print(" 同比(vs {}): 收入{} {:.1f}%".format(yoy_month, arrow, abs(yoy_inc_pct))) print("") if income_by_cat: print(" 📥 收入明细:") sorted_income = sorted(income_by_cat.items(), key=lambda x: x[1], reverse=True) for cat, amount in sorted_income: pct = amount / total_income * 100 if total_income > 0 else 0 bar_len = int(pct / 5) bar = "█" * bar_len print(" {:<8s} {:>10s} ({:>5.1f}%) {}".format(cat, fmt_money(amount), pct, bar)) print("") if expense_by_cat: print(" 📤 支出明细:") sorted_expense = sorted(expense_by_cat.items(), key=lambda x: x[1], reverse=True) for cat, amount in sorted_expense: pct = amount / total_expense * 100 if total_expense > 0 else 0 bar_len = int(pct / 5) bar = "█" * bar_len budget_info = "" if cat in budgets: budget_val = budgets[cat] if amount > budget_val: budget_info = " ⚠️ 超预算 {}".format(fmt_money(amount - budget_val)) else: budget_info = " ✅ 预算内 (剩{})".format(fmt_money(budget_val - amount)) print(" {:<8s} {:>10s} ({:>5.1f}%) {}{}".format( cat, fmt_money(amount), pct, bar, budget_info)) print("") # === 支出TOP3 + 省钱建议 === if expense_by_cat: sorted_exp = sorted(expense_by_cat.items(), key=lambda x: x[1], reverse=True) print(" 🔥 支出TOP3:") for i, (cat, amount) in enumerate(sorted_exp[:3], 1): pct = amount / total_expense * 100 print(" {}. {} — {} 元 ({:.1f}%)".format(i, cat, fmt_money(amount), pct)) print("") # 日均统计 days_in_month = set(r['date'] for r in filtered) num_days = len(days_in_month) if num_days > 0: print(" 📅 统计:") print(" 记录天数: {} 天".format(num_days)) print(" 日均支出: {} 元".format(fmt_money(total_expense / num_days))) if total_income > 0: print(" 日均收入: {} 元".format(fmt_money(total_income / num_days))) print("") def set_goal(name, target_amount, months): """设置存钱目标""" goals = load_goals() target = round(float(target_amount), 2) num_months = int(months) monthly_need = round(target / num_months, 2) now = datetime.datetime.now() goal = { 'name': name, 'target': target, 'months': num_months, 'monthly_need': monthly_need, 'created': now.strftime("%Y-%m-%d"), 'saved': 0, } # 更新已有目标或新增 updated = False for i, g in enumerate(goals): if g['name'] == name: goals[i] = goal updated = True break if not updated: goals.append(goal) save_goals(goals) print("") print("🎯 存钱目标设置成功!") print("─" * 40) print(" 目标名称: {}".format(name)) print(" 目标金额: {} 元".format(fmt_money(target))) print(" 计划周期: {} 个月".format(num_months)) print(" 每月需存: {} 元".format(fmt_money(monthly_need))) print("") print(" 💡 每天约需存 {} 元".format(fmt_money(monthly_need / 30))) print("") def show_goals(): """查看所有存钱目标进度""" goals = load_goals() if not goals: print("") print("🎯 暂无存钱目标") print(" 用 book.sh goal <目标名> <金额> <月数> 创建") print("") return records = load_records() # 计算实际结余作为"已存"参考 print("") print("🎯 存钱目标追踪") print("=" * 50) for g in goals: created = g.get('created', '2026-01-01') saved = g.get('saved', 0) target = g['target'] pct = (saved / target * 100) if target > 0 else 0 bar_total = 20 bar_filled = int(pct / 100 * bar_total) bar = "█" * bar_filled + "░" * (bar_total - bar_filled) remaining = max(target - saved, 0) months_left = g.get('months', 12) print("") print(" 📌 {}".format(g['name'])) print(" 目标: {} 元 | 周期: {} 个月".format(fmt_money(target), g['months'])) print(" 已存: {} 元 | 剩余: {} 元".format(fmt_money(saved), fmt_money(remaining))) print(" 进度: [{}] {:.1f}%".format(bar, pct)) print(" 每月需存: {} 元".format(fmt_money(g.get('monthly_need', target / max(months_left, 1))))) if saved >= target: print(" 🎉 目标已达成!恭喜!") print("") def save_to_goal(name, amount): """往目标里存钱""" goals = load_goals() found = False for g in goals: if g['name'] == name: g['saved'] = g.get('saved', 0) + round(float(amount), 2) found = True target = g['target'] saved = g['saved'] pct = (saved / target * 100) if target > 0 else 0 save_goals(goals) print("") print("💰 存入成功!") print("─" * 35) print(" 目标: {}".format(name)) print(" 本次存入: {} 元".format(fmt_money(float(amount)))) print(" 累计已存: {} 元".format(fmt_money(saved))) print(" 目标进度: {:.1f}%".format(pct)) if saved >= target: print(" 🎉 恭喜!目标已达成!") else: print(" 剩余: {} 元".format(fmt_money(target - saved))) print("") break if not found: print("") print("⚠️ 未找到目标: {}".format(name)) print(" 用 book.sh goal <目标名> <金额> <月数> 创建") print("") def show_help(): print("=" * 50) print(" 记账管家") print("=" * 50) print("") print("用法:") print(' book.sh add <金额> <类别> <备注> [--type income|expense]') print(" 记一笔账(默认为支出)") print(" book.sh list [--month YYYY-MM]") print(" 查看记录(默认当月)") print(" book.sh report [--month YYYY-MM]") print(" 月度收支报表(含同比环比+分类饼图)") print(" book.sh budget <类别> <月预算>") print(" 设置类别月预算") print(" book.sh goal <目标名> <金额> <月数>") print(" 设置存钱目标") print(" book.sh goal-save <目标名> <金额>") print(" 往目标里存钱") print(" book.sh goals") print(" 查看所有存钱目标进度") print(" book.sh help") print(" 显示帮助") print("") print("示例:") print(' book.sh add 35.5 餐饮 "午餐外卖"') print(' book.sh add 15000 工资 "3月工资" --type income') print(" book.sh list") print(" book.sh list --month 2026-02") print(" book.sh report") print(" book.sh budget 餐饮 2000") print(' book.sh goal "买相机" 8000 6') print(' book.sh goal-save "买相机" 1500') print(" book.sh goals") print("") print("数据存储: ~/.bookkeeping/") def main(): args = sys.argv[1:] if len(args) == 0: show_help() return cmd = args[0] if cmd == 'help': show_help() elif cmd == 'add': if len(args) < 4: print("用法: book.sh add <金额> <类别> <备注> [--type income|expense]") sys.exit(1) amount = args[1] category = args[2] note = args[3] record_type = "expense" if '--type' in args: idx = args.index('--type') if idx + 1 < len(args): record_type = args[idx + 1] if record_type not in ('income', 'expense'): print("类型必须是 income 或 expense") sys.exit(1) add_record(amount, category, note, record_type) elif cmd == 'list': month = get_current_month() if '--month' in args: idx = args.index('--month') if idx + 1 < len(args): month = args[idx + 1] list_records(month) elif cmd == 'report': month = get_current_month() if '--month' in args: idx = args.index('--month') if idx + 1 < len(args): month = args[idx + 1] enhanced_report(month) elif cmd == 'budget': if len(args) < 3: print("用法: book.sh budget <类别> <月预算>") sys.exit(1) set_budget(args[1], args[2]) elif cmd == 'goal': if len(args) < 4: print("用法: book.sh goal <目标名> <金额> <月数>") sys.exit(1) set_goal(args[1], args[2], args[3]) elif cmd == 'goal-save': if len(args) < 3: print("用法: book.sh goal-save <目标名> <金额>") sys.exit(1) save_to_goal(args[1], args[2]) elif cmd == 'goals': show_goals() else: print("未知命令: {}".format(cmd)) print("运行 'book.sh help' 查看帮助") sys.exit(1) if __name__ == '__main__': main() PYTHON_SCRIPT echo "" echo " Powered by BytesAgain | bytesagain.com | [email protected]" FILE:scripts/script.sh #!/usr/bin/env bash # beancount - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/beancount}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF beancount v$VERSION Multi-purpose utility tool Usage: beancount <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "beancount v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # 💰 记账理财小贴士 ## 为什么要记账? 1. **知道钱花哪了** — 80%的人不知道自己每月最大支出类别 2. **控制消费冲动** — 记账后平均减少15%~20%的非必要支出 3. **实现财务目标** — 有记账习惯的人存钱速度是不记账的2倍 ## 记账的黄金法则 ### 📌 简单原则 - **随手记** — 花完钱立刻记,别攒到月底 - **分类清晰** — 建议6~8个类别:餐饮、交通、购物、娱乐、居住、医疗、教育、其他 - **不要太细** — "午餐外卖"够了,不需要"午餐外卖-美团-麻辣烫" - **收入也要记** — 不只是工资,奖金、兼职、红包都要 ### 📌 50-30-20法则(最简单的预算方案) - **50% 必要支出** — 房租/房贷、吃饭、交通、水电 - **30% 可选支出** — 购物、娱乐、旅行、社交 - **20% 储蓄投资** — 存钱、基金定投、保险 ### 📌 预算管理要点 - 先设总预算,再分配到各类别 - 预算不是要你不花钱,是帮你花对钱 - 超预算20%以内算正常波动 - 连续3个月超预算就要调整(预算太低or消费太高) - 餐饮和交通最容易超支,重点关注 ## 存钱目标技巧 ### 📌 SMART目标法 - **S 具体** — "买iPhone"而不是"买东西" - **M 可衡量** — "8000元"而不是"一些钱" - **A 可实现** — 月薪1万别设月存8000的目标 - **R 有意义** — 跟你的生活有关联 - **T 有期限** — "6个月内"而不是"以后" ### 📌 存钱小技巧 1. **365存钱法** — 第1天存1元,第2天存2元…一年存66795元 2. **52周存钱法** — 第1周存10元,每周加10元,一年存13780元 3. **工资分账户** — 发工资当天转20%到不动账户 4. **零花钱存钱罐** — 每天剩余的零钱存起来 5. **消费降级测试** — 每月选1个类别试试花一半 ## 月度报表怎么看? ### 📌 关键指标 - **储蓄率** — >20%优秀,10%~20%及格,<10%危险 - **收入增长** — 同比(vs去年同月)反映真实增长 - **支出趋势** — 环比(vs上月)看短期变化 - **最大支出类别** — 占比>40%的类别要重点优化 ### 📌 分析套路 1. 先看总收入和总支出的差(结余) 2. 看储蓄率是否达标(>20%) 3. 看TOP3支出类别是否合理 4. 看预算执行情况(哪些超了) 5. 看环比变化(是不是比上月花得多了) ## 常见记账误区 1. ❌ 记太细 → 坚持不下去 2. ❌ 只记支出不记收入 → 不知道储蓄率 3. ❌ 设完预算就不管 → 月底才发现超了 4. ❌ 一笔大的忘记 → 数据不准 5. ❌ 追求完美 → 差几块钱无所谓,趋势比精确重要 ## 推荐记账节奏 | 频率 | 做什么 | |------|--------| | 每天 | 记录当天收支 | | 每周 | 看一眼本周花了多少 | | 每月 | 生成月度报表,检查预算 | | 每季 | 调整预算和存钱目标 | | 每年 | 年度总结,制定新年计划 | --- > 💡 记账不是为了省钱,是为了把钱花在值得的地方。 > > 数据来源: 中国家庭金融调查(CHFS)、随手记年度报告
FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, L system prompts and models of ai tools, python, ai, bolt.
--- version: "2.0.0" name: System Prompts And Models Of Ai Tools description: "FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, L system prompts and models of ai tools, python, ai, bolt." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # System Prompts And Models Of Ai Tools FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, Lovable, Manus, NotionAI, Orchids.app, Perplexity, Poke, Qoder, Replit, Same.dev, Trae, Traycer AI, VSCode Agent, Warp.dev, Windsurf, Xcode, Z.ai Code, Dia & v0. (And other Open Sourced) System Prompts, Internal Tools & AI Models ## Commands - `help` - Help - `run` - Run - `info` - Info - `status` - Status ## Features - Core functionality from x1xhlol/ai-prompt-library ## Usage Run any command: `ai-prompt-library <command> [args]` --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help ai-prompt-library help # Run ai-prompt-library run ``` ## Requirements - bash 4+ - python3 (standard library only) FILE:scripts/script.sh #!/usr/bin/env bash # ai-prompt-library - AI and prompt engineering assistant set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/ai-prompt-library}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF ai-prompt-library v$VERSION AI and prompt engineering assistant Usage: ai-prompt-library <command> [args] Commands: prompt Generate prompt system System prompt chain Prompt chain template Prompt templates compare Compare models cost Cost estimator optimize Optimize prompt # Evaluate output safety Safety guidelines tools AI tool list help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_prompt() { echo " Role: $1 Task: -assist Format: -text" _log "prompt" "-" } cmd_system() { echo " You are an expert $1. Be precise, helpful, and concise." _log "system" "-" } cmd_chain() { echo " Step 1: Understand | Step 2: Plan | Step 3: Execute | Step 4: Verify" _log "chain" "-" } cmd_template() { echo " 1. Zero-shot | 2. Few-shot | 3. Chain-of-thought | 4. Role-play" _log "template" "-" } cmd_compare() { echo " GPT-4 vs Claude vs Gemini: benchmark comparison" _log "compare" "-" } cmd_cost() { local _cost _cost=$(TOKENS="-1000" python3 << 'PYEOF2' import os tokens = int(os.environ["TOKENS"]) print("{:.4f}".format(tokens * 0.00003)) PYEOF2 ) 2>/dev/null || _cost="?" echo " Tokens: ~$1 | Cost: ~\$$_cost" _log "cost" "-" } cmd_optimize() { echo " Tips: Be specific | Add examples | Set format | Constrain length" _log "optimize" "-" } cmd_evaluate() { echo " Check: accuracy | relevance | completeness | tone" _log "evaluate" "-" } cmd_safety() { echo " 1. No harmful content | 2. No personal data | 3. Cite sources" _log "safety" "-" } cmd_tools() { echo " ChatGPT | Claude | Gemini | Perplexity | Midjourney" _log "tools" "-" } case "-help" in prompt) shift; cmd_prompt "$@" ;; system) shift; cmd_system "$@" ;; chain) shift; cmd_chain "$@" ;; template) shift; cmd_template "$@" ;; compare) shift; cmd_compare "$@" ;; cost) shift; cmd_cost "$@" ;; optimize) shift; cmd_optimize "$@" ;; evaluate) shift; cmd_"$@" ;; safety) shift; cmd_safety "$@" ;; tools) shift; cmd_tools "$@" ;; help|-h) show_help ;; version|-v) echo "ai-prompt-library v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/system_prompts_and_models_of_ai_tools.sh #!/usr/bin/env bash # System Prompts And Models Of Ai Tools - inspired by x1xhlol/system-prompts-and-models-of-ai-tools set -euo pipefail CMD="-help" shift 2>/dev/null || true case "$CMD" in help) echo "System Prompts And Models Of Ai Tools" echo "" echo "Commands:" echo " help Help" echo " run Run" echo " info Info" echo " status Status" echo "" echo "Powered by BytesAgain | bytesagain.com" ;; info) echo "System Prompts And Models Of Ai Tools v1.0.0" echo "Based on: https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools" echo "Stars: 130,696+" ;; run) echo "TODO: Implement main functionality" ;; status) echo "Status: ready" ;; *) echo "Unknown: $CMD" echo "Run 'system-prompts-and-models-of-ai-tools help' for usage" exit 1 ;; esac FILE:tips.md # Tips for System Prompts And Models Of Ai Tools ## Quick Start 1. Run `system-prompts-and-models-of-ai-tools help` to see available commands 2. Most commands output to stdout or generate files ## Source Based on [x1xhlol/system-prompts-and-models-of-ai-tools](https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools) - 130,696+ GitHub stars, Language: Python, License: GPL-3.0
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Cc Switch concepts, best practices, and implementation patterns.
--- name: "cc-switch" version: "3.0.1" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Cc Switch concepts, best practices, and implementation patterns." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [cc,switch, reference] category: "devtools" --- # Cc Switch Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Cc Switch 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 # cc-switch — Cc Switch reference tool. Use when working with cc switch in devtools contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="3.0.0" show_help() { cat << 'HELPEOF' cc-switch v$VERSION — Cc Switch Reference Tool Usage: cc-switch <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' # Cc Switch — Overview ## What is Cc Switch? Cc Switch (cc-switch) is a specialized tool/concept in the devtools domain. It provides essential capabilities for professionals working with cc switch. ## Key Concepts - Core cc switch principles and fundamentals - How cc switch fits into the broader devtools ecosystem - Essential terminology every practitioner should know ## Why Cc Switch Matters Understanding cc switch 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 cc switch concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Cc Switch — Quick Start Guide ## Prerequisites - Basic understanding of devtools concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the cc switch 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' # Cc Switch — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for cc switch 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' # Cc Switch — 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' # Cc Switch — 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' # Cc Switch — 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' # Cc Switch — 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' # Cc Switch — 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 "cc-switch v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: cc-switch help"; exit 1 ;; esac
This is my personal template collection. Here you'll find templates, and configurations for various boilerplates, python, ansible, docker, docker-compose.
--- version: "2.0.0" name: Boilerplates description: "This is my personal template collection. Here you'll find templates, and configurations for various boilerplates, python, ansible, docker, docker-compose." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Boilerplates This is my personal template collection. Here you'll find templates, and configurations for various tools, and technologies. ## Commands - `help` - Help - `run` - Run - `info` - Info - `status` - Status ## Features - Core functionality from ChristianLempa/boilerplates ## Usage Run any command: `boilerplates <command> [args]` --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help boilerplates help # Run boilerplates run ``` - Run `boilerplates help` for all commands ## Output Results go to stdout. Save with `boilerplates run > output.txt`. ## Output Results go to stdout. Save with `boilerplates run > output.txt`. FILE:scripts/boilerplates.sh #!/usr/bin/env bash # Boilerplates - inspired by ChristianLempa/boilerplates set -euo pipefail CMD="-help" shift 2>/dev/null || true case "$CMD" in help) echo "Boilerplates" echo "" echo "Commands:" echo " help Help" echo " run Run" echo " info Info" echo " status Status" echo "" echo "Powered by BytesAgain | bytesagain.com" ;; info) echo "Boilerplates v1.0.0" echo "Based on: https://github.com/ChristianLempa/boilerplates" echo "Stars: 7,494+" ;; run) echo "TODO: Implement main functionality" ;; status) echo "Status: ready" ;; *) echo "Unknown: $CMD" echo "Run 'boilerplates help' for usage" exit 1 ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # boilerplates - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/boilerplates}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF boilerplates v$VERSION Multi-purpose utility tool Usage: boilerplates <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "boilerplates v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Tips for Boilerplates ## Quick Start 1. Run `boilerplates help` to see available commands 2. Most commands output to stdout or generate files ## Source Based on [ChristianLempa/boilerplates](https://github.com/ChristianLempa/boilerplates) - 7,494+ GitHub stars, Language: Python, License: MIT
Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Awesome Cloudflare concepts, best practices, and implementation p...
--- name: "awesome-cloudflare" version: "3.0.1" description: "Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Awesome Cloudflare concepts, best practices, and implementation p..." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [awesome,cloudflare, reference] category: "devtools" --- # Awesome Cloudflare Reference tool for devtools — covers intro, quickstart, patterns and more. Quick lookup for Awesome Cloudflare concepts, best practices, and implementation p... 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 # awesome-cloudflare — Awesome Cloudflare reference tool. Use when working with awesome cloudflare in sysops contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="3.0.0" show_help() { cat << 'HELPEOF' awesome-cloudflare v$VERSION — Awesome Cloudflare Reference Tool Usage: awesome-cloudflare <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' # Awesome Cloudflare — Overview ## What is Awesome Cloudflare? Awesome Cloudflare (awesome-cloudflare) is a specialized tool/concept in the sysops domain. It provides essential capabilities for professionals working with awesome cloudflare. ## Key Concepts - Core awesome cloudflare principles and fundamentals - How awesome cloudflare fits into the broader sysops ecosystem - Essential terminology every practitioner should know ## Why Awesome Cloudflare Matters Understanding awesome cloudflare is critical for: - Improving efficiency in sysops workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic awesome cloudflare concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_quickstart() { cat << 'EOF' # Awesome Cloudflare — Quick Start Guide ## Prerequisites - Basic understanding of sysops concepts - Required tools and access credentials - System meeting minimum requirements ## Installation 1. Download or clone the awesome cloudflare 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' # Awesome Cloudflare — Common Patterns & Best Practices ## Design Patterns 1. **Standard Pattern**: The most common approach for awesome cloudflare 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' # Awesome Cloudflare — 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' # Awesome Cloudflare — 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' # Awesome Cloudflare — 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' # Awesome Cloudflare — 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' # Awesome Cloudflare — 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 "awesome-cloudflare v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: awesome-cloudflare help"; exit 1 ;; esac
营销文案助手。标题公式(100个)、正文写作、AIDA框架、痛点挖掘、客户证言、落地页文案。Copywriting with 100 headline formulas, body copy, AIDA framework, pain points, testimonials.
--- version: "2.0.0" name: adwords description: "营销文案助手。标题公式(100个)、正文写作、AIDA框架、痛点挖掘、客户证言、落地页文案。Copywriting with 100 headline formulas, body copy, AIDA framework, pain points, testimonials." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Copywriter ✍️ 营销文案全能助手,从标题到落地页一站搞定。 ## 使用方式 | 需求 | 命令 | 说明 | | Command | Description | |---------|-------------| | `headline` | 标题公式库(100个)+变体生成 | | `body` | 正文撰写(多种风格) | | `aida` | AIDA框架文案生成 | | `pains` | 用户痛点挖掘+文案转化 | | `testimonial` | 客户证言/评价文案 | | `landing` | 完整落地页文案 | ## 运行 ```bash bash scripts/copy.sh <command> [args...] ``` --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com - Run `adwords help` for all commands ## Commands Run `adwords help` to see all available commands. ## When to Use - to automate adwords tasks in your workflow - for batch processing adwords operations ## Output Returns formatted output to stdout. Redirect to a file with `adwords run > output.txt`. ## Configuration Set `ADWORDS_DIR` environment variable to change the data directory. Default: `~/.local/share/adwords/` FILE:scripts/copy.sh #!/usr/bin/env bash # copy.sh — 营销文案助手 # Usage: bash copy.sh <command> [args...] set -euo pipefail CMD="-help" shift 2>/dev/null || true show_help() { cat <<'HELP' Copywriter ✍️ — 营销文案助手 用法: bash copy.sh <command> [args...] 命令: headline 标题公式库(100个)+变体生成 body 正文撰写(多种风格) aida AIDA框架文案生成 pains 用户痛点挖掘+文案转化 testimonial 客户证言/评价文案 landing 完整落地页文案 示例: bash copy.sh headline bash copy.sh aida bash copy.sh landing Powered by BytesAgain | bytesagain.com | [email protected] HELP } cmd_headline() { cat <<'EOF' ## 🎯 标题公式库 (100个经典公式) 请AI使用以下公式为用户产品/服务生成标题: ### 数字型 (1-15) 1. [数字]个[方法]让你[好处] 2. [数字]个[错误]正在毁掉你的[目标] 3. [数字]分钟学会[技能] 4. [数字]%的人不知道的[秘密] 5. 每天[数字]分钟,[时间]后[结果] 6. [数字]步搞定[难题] 7. 只需[数字]元,获得[价值] 8. 前[数字]名[优惠] 9. [数字]年经验总结的[干货] 10. [数字]个理由让你选择[产品] 11. [数字]个案例证明[效果] 12. 超过[数字]人已经[行动] 13. [数字]天[挑战/变化] 14. TOP[数字][类别]推荐 15. [数字]招搞定[难题] ### 问题型 (16-30) 16. 你还在为[痛点]烦恼吗? 17. 为什么[反直觉]? 18. [目标],你做对了吗? 19. 怎样在[时间]内[成果]? 20. 你知道[令人惊讶的事实]吗? 21. [痛点]怎么办?试试这个 22. 想要[好处]?先解决[问题] 23. 为什么别人[成果]而你不能? 24. [目标]的秘密是什么? 25. 你属于哪种[类型]? 26. 是什么阻止了你[目标]? 27. [行为]真的有效吗? 28. 如何避免[常见错误]? 29. [身份]都在用的[方法]是什么? 30. 还在[旧方法]?试试[新方法] ### 好处型 (31-45) 31. 让你的[对象][好处]的终极指南 32. 不用[代价]也能[好处] 33. [产品]:[好处1]+[好处2]+[好处3] 34. 从[现状]到[理想]只需[方法] 35. [好处],就是这么简单 36. 终于,一个让[对象][好处]的方法 37. [好处]的[数字]个秘诀 38. 轻松实现[目标]的方法 39. 再也不用担心[痛点] 40. 让[对象]瞬间[好处] 41. 省[资源]又[好处]的[方案] 42. [身份]必备的[工具/方法] 43. 一次解决[多个痛点] 44. [好处],从这里开始 45. 你值得拥有[好处] ### 恐惧/紧迫型 (46-60) 46. 警告:[不行动的后果] 47. 不要再[错误行为]了! 48. 最后[时间]![优惠]即将结束 49. [数字]%的人都犯了这个错 50. 你可能正在[不知不觉中的损失] 51. 再不[行动]就晚了 52. 限时[优惠],错过等[时间] 53. 别让[痛点]毁掉你的[价值] 54. [紧急情况]?你需要这个 55. 仅剩[数字]个名额 56. 今天不[行动],明天[后果] 57. [行业]大变革,你准备好了吗? 58. [数字]个信号说明你需要[方案] 59. 停!在[行动]之前先看这个 60. 别人已经[行动]了,你呢? ### 故事/情感型 (61-75) 61. 我是如何从[困境]到[成功]的 62. 一个[身份]的[经历]告诉你 63. 他们说不可能,结果... 64. [时间]前我[困境],现在[成就] 65. [客户名]:[产品]改变了我的[方面] 66. 从[数字]到[数字],他只用了[方法] 67. 那些[成功的人]都知道的[秘密] 68. 一封来自[身份]的信 69. 我犯了[数字]个错误后才发现... 70. [产品]背后的故事 71. 为什么我放弃[旧方法]选择[新方法] 72. [数字]年[行业]老兵的真心话 73. 当[情境]时,[产品]救了我 74. 从怀疑到信赖:[客户]的[产品]之旅 75. [身份]的一天是怎样的 ### 权威/社证型 (76-90) 76. [权威机构]推荐的[产品] 77. [数字]位[身份]的共同选择 78. [行业]专家都在用的[方法] 79. [权威人物]说:[观点] 80. 荣获[奖项]的[产品] 81. 被[媒体]报道的[产品/方法] 82. [数字]年行业标准 83. [知名客户]都在用 84. 好评率[数字]%的[产品] 85. [排名]第一的[类别] 86. 复购率[数字]%的秘密 87. [数字]+用户验证有效 88. [认证/资质]认可的[产品] 89. [行业]口碑之选 90. 来自[地域]的专业[方案] ### 独特型 (91-100) 91. [产品]≠[常见误解] 92. 全网最[特点]的[产品] 93. 只有[条件]才能享受的[服务] 94. [产品]:重新定义[类别] 95. 一个[特点]的[产品] 96. 你从未见过的[类别] 97. [对比]:[产品]vs[竞品] 98. 不走寻常路的[方案] 99. [特点]+[特点]=[产品] 100. 如果[产品]会说话... ### 使用说明 1. 选择适合的公式类型 2. 填入产品/服务信息 3. 生成5-10个变体 4. 评估并A/B测试 EOF } cmd_body() { cat <<'EOF' ## 📝 正文撰写模板 请AI按以下风格撰写文案正文: ### 风格一:故事型 ``` [场景描述——让读者代入] [痛点描述——引发共鸣] [转折——解决方案出现] [产品/方法介绍——自然融入] [效果展示——数据/案例] [行动号召] ``` ### 风格二:干货型 ``` ## [标题——清晰价值主张] [开头hook——1-2句抓住注意力] ### 核心要点 **1. [要点一]** [解释] + [案例/数据] **2. [要点二]** [解释] + [案例/数据] **3. [要点三]** [解释] + [案例/数据] ### 总结 [重申价值] + [CTA] ``` ### 风格三:对话型 ``` "[读者心声/常见问题]" 没错,我理解你的感受。[共情] 但你知道吗?[转折/洞见] [解决方案——用"你"说话] [具体好处——列表式] 所以,[CTA——像朋友建议一样] ``` ### 正文检查清单 - [ ] 第一句话是否足够吸引 - [ ] 是否有具体数据支撑 - [ ] 段落是否足够短(3-4行/段) - [ ] 是否使用了"你"而非"我们" - [ ] CTA是否清晰明确 - [ ] 是否有社会证明 - [ ] 移动端阅读是否友好 EOF } cmd_aida() { cat <<'EOF' ## 🎪 AIDA框架文案生成器 请AI用AIDA框架生成完整文案: ### AIDA框架 #### A - Attention (注意力) **目标**: 在3秒内抓住眼球 技巧: - 震撼数据: "每天有XX人因为___而___" - 反常识: "你以为的___其实是错的" - 直击痛点: "还在为___烦恼?" - 视觉冲击: [描述画面/场景] #### I - Interest (兴趣) **目标**: 让读者继续读下去 技巧: - 展开痛点: "你是否经历过___?" - 讲故事: "[客户名]也曾___" - 提供洞见: "研究发现___" - 制造悬念: "解决方案比你想的简单..." #### D - Desire (欲望) **目标**: 让读者想要你的产品 技巧: - 好处列表: ✅ [好处1] ✅ [好处2] ✅ [好处3] - 前后对比: 使用前___ vs 使用后___ - 客户证言: "[真实评价]" - 数据证明: "[数字]% 的用户[效果]" - 降低风险: "XX天无理由退款" #### A - Action (行动) **目标**: 促使立即行动 技巧: - 紧迫感: "限时/限量/限额" - 简化行动: "只需[1步]" - 额外激励: "现在行动额外获得___" - 降低门槛: "免费试用/0元体验" ### AIDA文案模板 ``` 🎯 [Attention标题] [Interest段落——展开故事/痛点] 你将获得: ✅ [Desire好处1] ✅ [Desire好处2] ✅ [Desire好处3] [社会证明/数据] 👉 [Action CTA按钮] [紧迫提示] ``` ### 变体:PAS框架 - **P (Problem)**: 描述问题 - **A (Agitate)**: 加深痛感 - **S (Solution)**: 给出方案 EOF } cmd_pains() { cat <<'EOF' ## 😰 痛点挖掘工具 请AI帮助挖掘目标用户痛点: ### 输入信息 - **产品/服务**: [用户提供] - **目标用户**: [用户提供] ### 痛点挖掘矩阵 #### 五大痛点维度 | 维度 | 问题模板 | 文案转化 | |------|----------|----------| | ⏰ 时间 | "你是否花了太多时间在___?" | "节省X小时/天" | | 💰 金钱 | "你在___上浪费了多少钱?" | "省下X元,还能___" | | 🧠 能力 | "你是否觉得___太复杂?" | "小白也能X分钟上手" | | 😟 情感 | "___让你感到焦虑/不安吗?" | "告别焦虑,轻松___" | | 👥 社交 | "别人都___了,而你还在___" | "加入X万人的选择" | #### 痛点深度挖掘(5 Whys) ``` 表面痛点: [用户说的] ↓ 为什么? 第1层: [更深层原因] ↓ 为什么? 第2层: [更深层原因] ↓ 为什么? 第3层: [更深层原因] ↓ 为什么? 第4层: [根本原因] ↓ 为什么? 第5层: [核心需求/恐惧] ``` #### 痛点→文案转化模板 ``` 痛点: [具体问题描述] 情绪: [焦虑/无助/羞耻/恐惧/烦躁] 共鸣句: "[让用户说'对对对就是这样'的话]" 解决方案: [产品如何解决] 好处陈述: [使用后的理想状态] 文案: [完整文案段落] ``` #### 用户场景地图 | 场景 | 痛点 | 情绪 | 文案切入 | |------|------|------|----------| | 早晨 | | | | | 工作中 | | | | | 决策时 | | | | | 使用竞品 | | | | | 放弃时 | | | | ### 竞品痛点对比 | 维度 | 竞品A痛点 | 竞品B痛点 | 我们的优势 | |------|-----------|-----------|-----------| | 价格 | | | | | 体验 | | | | | 功能 | | | | | 服务 | | | | EOF } cmd_testimonial() { cat <<'EOF' ## 🌟 客户证言/评价文案 请AI生成客户证言文案: ### 证言框架 #### STAR证言法 ``` 📍 Situation (背景): "作为一个[身份],我一直在[痛点场景]..." 🎯 Task (需求): "我需要一个能[具体需求]的[解决方案]..." ⚡ Action (行动): "我开始使用[产品]后,[具体使用方式]..." 🏆 Result (结果): "[时间]后,[具体数据/变化]。 现在我[理想状态]。" — [姓名], [职位/身份], [公司/地点] ``` #### 短评模板(50-100字) ``` 类型1—效果型: "用了[产品][时间],[具体指标]从[前]提升到[后],太惊喜了!" 类型2—对比型: "之前用[竞品]一直[痛点],换了[产品]后终于[解决]了。" 类型3—情感型: "[产品]不只是[功能],更是[情感价值]。强烈推荐!" 类型4—推荐型: "已经推荐给[数字]个朋友了。大家都说[好处]。" ``` #### 案例故事(300-500字) ``` ## [客户名/公司] 的故事 ### 挑战 [客户面临什么问题,有多严重] ### 尝试 [之前尝试过什么方案,为什么不行] ### 选择 [为什么选择我们的产品,决策过程] ### 成果 - 📈 [数据1]: [前] → [后] - ⏰ [数据2]: [前] → [后] - 💰 [数据3]: [前] → [后] ### 评价 > "[客户原话引用]" > — [姓名], [职位] ``` ### 证言收集模板(问卷) 1. 您使用前面临什么挑战? 2. 您为什么选择我们? 3. 使用后最大的变化是什么? 4. 有具体的数据/结果可以分享吗? 5. 您会推荐给朋友吗?为什么? EOF } cmd_landing() { cat <<'EOF' ## 🖥️ 落地页文案结构 请AI生成完整落地页文案: ### 落地页七大区块 #### 1️⃣ 首屏 Hero Section ``` [大标题]: [核心价值主张,10字以内] [副标题]: [补充说明,20字以内] [CTA按钮]: [动词+好处] [信任标识]: [客户数/评分/认证] ``` #### 2️⃣ 痛点区 Problem Section ``` 你是否遇到过这些问题? 😰 [痛点1——场景化描述] 😰 [痛点2——场景化描述] 😰 [痛点3——场景化描述] 如果是,你不是一个人。[数据]%的[身份]都面临同样的困扰。 ``` #### 3️⃣ 方案区 Solution Section ``` [产品名]——[一句话定位] ✅ [功能1] → [好处1] ✅ [功能2] → [好处2] ✅ [功能3] → [好处3] [产品截图/演示描述] ``` #### 4️⃣ 社会证明 Social Proof ``` 已有 [数字]+ [身份] 信赖 [产品] ⭐⭐⭐⭐⭐ "[客户评价1]" — [姓名] ⭐⭐⭐⭐⭐ "[客户评价2]" — [姓名] ⭐⭐⭐⭐⭐ "[客户评价3]" — [姓名] [合作品牌Logo区] ``` #### 5️⃣ 价格区 Pricing Section ``` 选择适合你的方案: | 基础版 | 专业版 ⭐推荐 | 企业版 | |--------|-------------|--------| | ¥X/月 | ¥X/月 | 联系我们 | | [功能列表] | [功能列表] | [功能列表] | | [CTA] | [CTA] | [CTA] | 💡 所有方案含[保障]: [XX天无理由退款] ``` #### 6️⃣ FAQ区 ``` 常见问题 Q: [问题1]? A: [简洁回答] Q: [问题2]? A: [简洁回答] Q: [问题3]? A: [简洁回答] ``` #### 7️⃣ 最终CTA ``` 准备好[动词+目标]了吗? [大CTA按钮] 🔒 [安全保障] | 📞 [联系方式] | 💬 [在线客服] ``` ### 落地页检查清单 - [ ] 首屏3秒能理解价值主张 - [ ] CTA按钮颜色突出 - [ ] 至少3条社会证明 - [ ] 有风险逆转(退款保证等) - [ ] 移动端适配 - [ ] 加载速度<3秒 - [ ] FAQ覆盖主要疑虑 EOF } case "$CMD" in headline) cmd_headline ;; body) cmd_body ;; aida) cmd_aida ;; pains) cmd_pains ;; testimonial) cmd_testimonial ;; landing) cmd_landing ;; help|--help|-h) show_help ;; *) echo "❌ 未知命令: $CMD" echo "" show_help exit 1 ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # adwords - Content creation and optimization assistant set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/adwords}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF adwords v$VERSION Content creation and optimization assistant Usage: adwords <command> [args] Commands: draft Create draft headline Generate headlines outline Content outline seo SEO tips schedule Content schedule hooks Opening hooks cta Call to action repurpose Repurpose content metrics Content metrics ideas Content ideas help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_draft() { echo " Draft: $1 Target: -800 words" _log "draft" "-" } cmd_headline() { echo " 1. How to $1 2. $1: Complete Guide 3. Why $1 Matters" _log "headline" "-" } cmd_outline() { echo " 1. Intro | 2. Problem | 3. Solution | 4. Examples | 5. CTA" _log "outline" "-" } cmd_seo() { echo " Keywords: $1 | Title tag | Meta desc | H1-H3 | Internal links" _log "seo" "-" } cmd_schedule() { echo " Mon: Research | Tue: Write | Wed: Edit | Thu: Publish | Fri: Promote" _log "schedule" "-" } cmd_hooks() { echo " Question | Statistic | Story | Bold claim | Controversy" _log "hooks" "-" } cmd_cta() { echo " Subscribe | Share | Comment | Try it | Learn more" _log "cta" "-" } cmd_repurpose() { echo " Blog -> Thread -> Video -> Carousel -> Newsletter" _log "repurpose" "-" } cmd_metrics() { echo " Views | Clicks | Shares | Time on page | Conversions" _log "metrics" "-" } cmd_ideas() { echo " How-to | Listicle | Case study | Interview | Comparison" _log "ideas" "-" } case "-help" in draft) shift; cmd_draft "$@" ;; headline) shift; cmd_headline "$@" ;; outline) shift; cmd_outline "$@" ;; seo) shift; cmd_seo "$@" ;; schedule) shift; cmd_schedule "$@" ;; hooks) shift; cmd_hooks "$@" ;; cta) shift; cmd_cta "$@" ;; repurpose) shift; cmd_repurpose "$@" ;; metrics) shift; cmd_metrics "$@" ;; ideas) shift; cmd_ideas "$@" ;; help|-h) show_help ;; version|-v) echo "adwords v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Copywriter Tips ✍️ ## 文案核心法则 1. **AIDA**: Attention → Interest → Desire → Action 2. **PAS**: Problem → Agitate → Solution 3. **BAB**: Before → After → Bridge 4. **4U**: Urgent + Unique + Ultra-specific + Useful ## 标题黄金法则 - 数字开头转化率更高(奇数优于偶数) - 长度:中文10-20字 / 英文6-12词 - 包含好处或解决的痛点 - 创造好奇心但不做标题党 ## 正文写作技巧 - 第一句话的唯一目的:让人读第二句 - 短句>长句,短段>长段 - 多用"你",少用"我们" - 用具体数字代替模糊描述 - 一个段落=一个观点 ## CTA按钮文案公式 - 动词 + 好处: "获取免费方案" - 避免: "提交" "点击这里" - 制造紧迫感: "立即" "限时" - 降低风险: "免费试用" "无需绑卡" ## 痛点挖掘维度 - 时间痛点: 太慢、太花时间 - 金钱痛点: 太贵、浪费钱 - 能力痛点: 太难、学不会 - 情感痛点: 焦虑、不自信 - 社交痛点: 被比较、被忽视
Comfortably monitor your Internet traffic 🕵️♂️ Based on GyulyVGC/sniffnet (32,966+ GitHub stars). network monitor, rust, application, gui, iced, linux, macos
--- name: Network Monitor description: "Comfortably monitor your Internet traffic 🕵️♂️ Based on GyulyVGC/sniffnet (32,966+ GitHub stars). network monitor, rust, application, gui, iced, linux, macos" version: 1.0.0 license: Apache-2.0 runtime: python3 --- # Network Monitor Comfortably monitor your Internet traffic 🕵️♂️ Inspired by [GyulyVGC/sniffnet](https://github.com/GyulyVGC/sniffnet) (32,966+ GitHub stars). ## Commands - `help` - Help - `run` - Run - `info` - Info - `status` - Status ## Features - Core functionality from GyulyVGC/sniffnet ## Usage Run any command: `network-monitor <command> [args]` --- > **Disclaimer**: This skill is an independent, original implementation. It is not affiliated with, endorsed by, or derived from the referenced open-source project. No code was copied. The reference is for context only. Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/network_monitor.sh #!/usr/bin/env bash # Original implementation by BytesAgain (bytesagain.com) # This is independent code, not derived from any third-party source # License: MIT # Network Monitor — network traffic & connectivity monitoring (inspired by sniffnet 32K+ stars) set -euo pipefail CMD="-help" shift 2>/dev/null || true case "$CMD" in help) echo "Network Monitor — connectivity & traffic analysis" echo "Commands:" echo " status Network interfaces status" echo " connections Active connections" echo " ports Listening ports" echo " bandwidth Bandwidth usage estimate" echo " latency <host> Latency test" echo " trace <host> Traceroute" echo " dns <domain> DNS resolution" echo " whois <domain> Domain info" echo " speed Download speed test" echo " info Version info" echo "Powered by BytesAgain | bytesagain.com";; status) python3 << 'PYEOF' import os print("Network Interfaces:") for iface in os.listdir("/sys/class/net/"): state = open("/sys/class/net/{}/operstate".format(iface)).read().strip() try: mac = open("/sys/class/net/{}/address".format(iface)).read().strip() except: mac = "?" try: rx = int(open("/sys/class/net/{}/statistics/rx_bytes".format(iface)).read().strip()) tx = int(open("/sys/class/net/{}/statistics/tx_bytes".format(iface)).read().strip()) except: rx, tx = 0, 0 print(" {:10s} {:5s} {:17s} RX:{:.1f}MB TX:{:.1f}MB".format( iface, state, mac, rx/1048576, tx/1048576)) PYEOF ;; connections) echo "Active Connections:" ss -tn 2>/dev/null | head -30 || netstat -tn 2>/dev/null | head -30 echo "" echo "Summary:" ss -s 2>/dev/null || echo "(ss not available)";; ports) echo "Listening Ports:" ss -tlnp 2>/dev/null || netstat -tlnp 2>/dev/null;; bandwidth) python3 << 'PYEOF' import time def get_bytes(): d = {} with open("/proc/net/dev") as f: for line in f: if ":" in line: parts = line.split(":") iface = parts[0].strip() vals = parts[1].split() d[iface] = {"rx": int(vals[0]), "tx": int(vals[8])} return d print("Measuring bandwidth (5 seconds)...") t1 = get_bytes() time.sleep(5) t2 = get_bytes() print("{:10s} {:>12s} {:>12s}".format("Interface", "Download", "Upload")) print("-" * 38) for iface in sorted(t2): if iface in t1: rx = (t2[iface]["rx"] - t1[iface]["rx"]) / 5 tx = (t2[iface]["tx"] - t1[iface]["tx"]) / 5 if rx > 0 or tx > 0: print("{:10s} {:>10.1f}KB/s {:>10.1f}KB/s".format(iface, rx/1024, tx/1024)) PYEOF ;; latency) host="-8.8.8.8"; ping -c 5 "$host" 2>/dev/null || echo "ping failed";; trace) host="-8.8.8.8"; traceroute -m 15 "$host" 2>/dev/null || tracepath "$host" 2>/dev/null || echo "traceroute not available";; dns) domain="-"; [ -z "$domain" ] && { echo "Usage: dns <domain>"; exit 1; } python3 -c " import socket domain = '$domain' print('DNS: {}'.format(domain)) for info in socket.getaddrinfo(domain, None): fam = 'IPv4' if info[0] == socket.AF_INET else 'IPv6' print(' {} {}'.format(fam, info[4][0])) ";; whois) domain="-"; [ -z "$domain" ] && { echo "Usage: whois <domain>"; exit 1; } whois "$domain" 2>/dev/null | head -30 || echo "whois not available";; speed) python3 << 'PYEOF' import time try: from urllib.request import urlopen except: from urllib2 import urlopen print("Download Speed Test...") url = "http://speedtest.tele2.net/1MB.zip" start = time.time() try: data = urlopen(url, timeout=30).read() elapsed = time.time() - start mb = len(data) / 1048576 print(" Downloaded: {:.1f} MB in {:.1f}s".format(mb, elapsed)) print(" Speed: {:.1f} Mbps".format(mb * 8 / elapsed)) except Exception as e: print(" Error: {}".format(e)) PYEOF ;; info) echo "Network Monitor v1.0.0"; echo "Inspired by: sniffnet (32,000+ stars)"; echo "Powered by BytesAgain | bytesagain.com";; *) echo "Unknown: $CMD"; exit 1;; esac FILE:tips.md # Tips for Network Monitor ## Quick Start 1. Run `network-monitor help` to see available commands 2. Most commands output to stdout or generate files ## Source Based on [GyulyVGC/sniffnet](https://github.com/GyulyVGC/sniffnet) - 32,966+ GitHub stars, Language: Rust, License: Apache-2.0
中国农历工具。节气查询、生肖年份、黄道吉日、传统节日、天干地支、农历转换。Chinese lunar calendar with solar terms, zodiac, auspicious dates, festivals, and Heavenly Stems.
--- name: "chinese-calendar-cn" version: "5.0.0" description: "中国农历工具。节气查询、生肖年份、黄道吉日、传统节日、天干地支、农历转换。Chinese lunar calendar with solar terms, zodiac, auspicious dates, festivals, and Heavenly Stems." author: "BytesAgain" homepage: "https://bytesagain.com" source: "https://github.com/bytesagain/ai-skills" tags: [chinese-calendar, lunar, zodiac, solar-terms, festivals, 农历, 节气, 生肖] category: "lifestyle" --- # Chinese Calendar 中国农历 中国传统历法参考工具。二十四节气、十二生肖、天干地支、传统节日、黄道吉日速查。无需API,纯本地输出。 ## Commands | Command | Description | |---------|-------------| | `jieqi` | 二十四节气完整表(日期、含义、农事、习俗) | | `shengxiao` | 十二生肖年份速查 + 性格 + 相合相冲 | | `tiangan` | 天干地支六十甲子纪年法详解 | | `jieri` | 中国传统节日(农历日期、来历、习俗、食物) | | `jiri` | 黄道吉日择日参考(婚嫁、搬家、开业等) | | `zhuanhuan` | 公历↔农历转换规则与闰月说明 | | `minsu` | 民俗禁忌与传统讲究 | | `faq` | 常见问题(闰月、节气偏移、新旧历差异等) | ## Usage ```bash chinese-calendar-cn jieqi # 二十四节气 chinese-calendar-cn shengxiao # 十二生肖 chinese-calendar-cn tiangan # 天干地支 chinese-calendar-cn jieri # 传统节日 chinese-calendar-cn jiri # 黄道吉日 chinese-calendar-cn zhuanhuan # 公农历转换 chinese-calendar-cn minsu # 民俗禁忌 chinese-calendar-cn faq # 常见问题 ``` ## Output Format All commands output plain-text reference documentation in Chinese. No external API calls, no credentials needed. --- *Powered by BytesAgain | bytesagain.com* FILE:scripts/script.sh #!/usr/bin/env bash # chinese-calendar-cn — Chinese Calendar Cn reference tool. Use when working with chinese calendar cn in life contexts. # Powered by BytesAgain | bytesagain.com | [email protected] set -euo pipefail VERSION="4.0.0" show_help() { cat << 'HELPEOF' chinese-calendar-cn v$VERSION — Chinese Calendar Cn Reference Tool Usage: chinese-calendar-cn <command> Commands: intro Overview and basics guide Step-by-step guide tips Pro tips and tricks planning Planning and preparation resources Recommended resources mistakes Common mistakes to avoid examples Real-world examples faq Frequently asked questions help Show this help version Show version Powered by BytesAgain | bytesagain.com HELPEOF } cmd_intro() { cat << 'EOF' # Chinese Calendar Cn — Overview ## What is Chinese Calendar Cn? Chinese Calendar Cn (chinese-calendar-cn) is a specialized tool/concept in the life domain. It provides essential capabilities for professionals working with chinese calendar cn. ## Key Concepts - Core chinese calendar cn principles and fundamentals - How chinese calendar cn fits into the broader life ecosystem - Essential terminology every practitioner should know ## Why Chinese Calendar Cn Matters Understanding chinese calendar cn is critical for: - Improving efficiency in life workflows - Reducing errors and downtime - Meeting industry standards and compliance requirements - Enabling better decision-making with accurate data ## Getting Started 1. Understand the basic chinese calendar cn concepts 2. Learn the standard tools and interfaces 3. Practice with common scenarios 4. Review safety and compliance requirements EOF } cmd_guide() { cat << 'EOF' # Chinese Calendar Cn — Step-by-Step Guide ## Overview This guide walks you through the essential chinese calendar cn workflows. ## Step 1: Preparation - Gather required materials and information - Review prerequisites and requirements - Set up your workspace ## Step 2: Execution - Follow the standard procedure - Monitor progress at each stage - Document any deviations ## Step 3: Verification - Check results against expected outcomes - Run validation tests - Get peer review if applicable ## Step 4: Documentation - Record what was done and the results - Note any lessons learned - Update procedures if needed EOF } cmd_tips() { cat << 'EOF' # Chinese Calendar Cn — Pro Tips & Tricks ## Efficiency Tips 1. Automate repetitive tasks 2. Use templates for common operations 3. Set up keyboard shortcuts 4. Batch similar operations together 5. Keep a personal cheat sheet ## Expert Tricks - Learn the less-known features - Build custom workflows - Connect with the community for insights - Study how experts approach problems - Practice regularly to build muscle memory EOF } cmd_planning() { cat << 'EOF' # Chinese Calendar Cn — Planning & Preparation ## Planning Framework 1. **Define Goals**: What do you want to achieve? 2. **Assess Current State**: Where are you now? 3. **Identify Gaps**: What needs to change? 4. **Create Plan**: Steps, timeline, resources 5. **Execute & Monitor**: Track progress ## Resource Planning - Budget allocation - Team and skills needed - Tools and infrastructure - Timeline and milestones EOF } cmd_resources() { cat << 'EOF' # Chinese Calendar Cn — Recommended Resources ## Learning Resources - Official documentation and guides - Online courses and tutorials - Community forums and Q&A sites - Books and publications ## Tools - Essential software and utilities - Online calculators and generators - Testing and validation tools - Monitoring and analytics platforms EOF } cmd_mistakes() { cat << 'EOF' # Chinese Calendar Cn — Common Mistakes to Avoid ## Top Mistakes 1. **Skipping planning**: Jumping in without understanding requirements 2. **Ignoring documentation**: Not recording decisions and changes 3. **Over-complicating**: Adding unnecessary complexity 4. **Skipping tests**: Deploying without verification 5. **Working in isolation**: Not seeking feedback or review ## How to Avoid Them - Use checklists for routine operations - Always test before deploying - Get peer review on important changes - Keep documentation current - Learn from past incidents EOF } cmd_examples() { cat << 'EOF' # Chinese Calendar Cn — Real-World Examples ## Example 1: Basic Setup A typical chinese calendar cn setup for a small team: - Standard configuration with defaults - Basic monitoring enabled - Manual backup schedule ## Example 2: Production Deployment An enterprise chinese calendar cn deployment: - High-availability configuration - Automated monitoring and alerting - Continuous backup with point-in-time recovery ## Example 3: Troubleshooting Scenario When things go wrong: - Symptom identification - Root cause analysis - Fix implementation and verification EOF } cmd_faq() { cat << 'EOF' # Chinese Calendar Cn — Frequently Asked Questions ## General **Q: What is Chinese Calendar Cn?** A: Chinese Calendar Cn is a reference tool for chinese calendar cn in the life domain. **Q: Who should use this?** A: Anyone working with chinese calendar cn who needs quick reference material. **Q: How do I get started?** A: Run the intro command for an overview, then explore other commands. ## Technical **Q: What are the system requirements?** A: Bash 4.0+ on any Unix-like system (Linux, macOS). **Q: Can I customize the output?** A: The tool provides reference content. Customize by editing the script. **Q: How do I report issues?** A: Visit github.com/bytesagain/ai-skills or email [email protected] EOF } CMD="-help" shift 2>/dev/null || true case "$CMD" in intro) cmd_intro "$@" ;; guide) cmd_guide "$@" ;; tips) cmd_tips "$@" ;; planning) cmd_planning "$@" ;; resources) cmd_resources "$@" ;; mistakes) cmd_mistakes "$@" ;; examples) cmd_examples "$@" ;; faq) cmd_faq "$@" ;; help|--help|-h) show_help ;; version|--version|-v) echo "chinese-calendar-cn v$VERSION — Powered by BytesAgain" ;; *) echo "Unknown: $CMD"; echo "Run: chinese-calendar-cn help"; exit 1 ;; esac
自动化流程设计。Zapier/Make流程、触发器、动作链、条件逻辑、模板、效率分析。Automation recipes for Zapier, Make. 自动化、工作流、效率。
--- version: "2.0.0" name: Automation Recipe description: "Zapier Recipe Book. Use when you need zapier recipe capabilities. Triggers on: zapier recipe." 自动化流程设计。Zapier/Make流程、触发器、动作链、条件逻辑、模板、效率分析。Automation recipes for Zapier, Make. 自动化、工作流、效率。 author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Automation Recipe 自动化流程设计。Zapier/Make流程、触发器、动作链、条件逻辑、模板、效率分析。Automation recipes for Zapier, Make. 自动化、工作流、效率。 ## 为什么选择这个工具 - ✅ 专为中文用户设计,理解中国市场和文化 - ✅ 多种命令覆盖不同场景需求 - ✅ 输出实用、可直接使用的内容 - ✅ 持续更新,紧跟行业最新趋势 ## 命令列表 | 命令 | 功能 | |------|------| | `design` | design | | `trigger` | trigger | | `chain` | chain | | `condition` | condition | | `template` | template | | `efficiency` | efficiency | --- *Automation Recipe by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help zapier-recipe help # Run zapier-recipe run ``` - Run `zapier-recipe help` for all commands ## Commands Run `zapier-recipe help` to see all available commands. ## Output Results go to stdout. Save with `zapier-recipe run > output.txt`. FILE:scripts/script.sh #!/usr/bin/env bash # zapier-recipe - Developer workflow automation tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/zapier-recipe}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF zapier-recipe v$VERSION Developer workflow automation tool Usage: zapier-recipe <command> [args] Commands: init Initialize project check Run checks build Build project test Run tests deploy Deploy guide config Configuration status Project status template Code template docs Documentation clean Clean artifacts help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_init() { echo " Project initialized in $(pwd)" _log "init" "-" } cmd_check() { echo " Running lint + type check + tests..." _log "check" "-" } cmd_build() { echo " Building..." _log "build" "-" } cmd_test() { echo " Running test suite..." _log "test" "-" } cmd_deploy() { echo " Deploy: build -> test -> stage -> prod" _log "deploy" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: checking project health..." _log "status" "-" } cmd_template() { echo " Template for: $1" _log "template" "-" } cmd_docs() { echo " Generating docs..." _log "docs" "-" } cmd_clean() { echo " Cleaned build artifacts" _log "clean" "-" } case "-help" in init) shift; cmd_init "$@" ;; check) shift; cmd_check "$@" ;; build) shift; cmd_build "$@" ;; test) shift; cmd_test "$@" ;; deploy) shift; cmd_deploy "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; template) shift; cmd_template "$@" ;; docs) shift; cmd_docs "$@" ;; clean) shift; cmd_clean "$@" ;; help|-h) show_help ;; version|-v) echo "zapier-recipe v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/zapier.sh #!/usr/bin/env bash set -euo pipefail CMD="-help"; shift 2>/dev/null || true; INPUT="$*" python3 -c ' import sys cmd=sys.argv[1] if len(sys.argv)>1 else "help" inp=" ".join(sys.argv[2:]) RECIPES=[("Gmail to Slack","Trigger: New email in Gmail\nAction: Post message to Slack channel","Email notification, team updates"),("Form to Sheet","Trigger: New form submission (Typeform/Google Forms)\nAction: Create row in Google Sheets","Lead capture, surveys"),("Calendar to Todoist","Trigger: New Google Calendar event\nAction: Create task in Todoist","Meeting prep automation"),("Stripe to Email","Trigger: New payment in Stripe\nAction: Send thank you email","Customer onboarding"),("GitHub to Slack","Trigger: New PR/Issue on GitHub\nAction: Post to Slack dev channel","Dev team notifications"),("RSS to Twitter","Trigger: New RSS feed item\nAction: Create tweet","Content distribution"),("Notion to Email","Trigger: New item in Notion database\nAction: Send digest email","Project updates"),("Webhook to Sheets","Trigger: Catch webhook\nAction: Log to Google Sheets","API monitoring, logging")] if cmd=="browse": cat=inp.lower() if inp else "" print(" Popular Zap Recipes:") for i,(name,flow,use) in enumerate(RECIPES,1): if cat and cat not in name.lower() and cat not in use.lower(): continue print("\n {}. {}".format(i,name)) for line in flow.split("\n"): print(" {}".format(line.strip())) print(" Use: {}".format(use)) elif cmd=="custom": print(" Build Custom Zap:") print(" 1. TRIGGER: When ___ happens in [App]") print(" 2. FILTER: Only if [condition]") print(" 3. ACTION: Do ___ in [App]") print(" 4. (Optional) ACTION 2: Also do ___ in [App]") print("") print(" Popular triggers: New email, New row, Webhook, Schedule, New file") print(" Popular actions: Send email, Create row, Post message, Create task") elif cmd=="help": print("Zapier Recipe Book\n browse [keyword] — Browse automation recipes\n custom — Build custom zap template") else: print("Unknown: "+cmd) print("\nPowered by BytesAgain | bytesagain.com") ' "$CMD" $INPUT FILE:tips.md # Automation Recipe - tips.md ## Quick Reference
Play knowledge quizzes with facts, categories, and daily challenges. Use when learning topics, drilling flashcards, reviewing answers, tracking progress.
--- version: "2.0.0" name: Trivia Quiz description: "Play knowledge quizzes with facts, categories, and daily challenges. Use when learning topics, drilling flashcards, reviewing answers, tracking progress." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Trivia Quiz A learning and study assistant for self-paced education. Start learning sessions on any topic, run quick quizzes, drill with flashcards, review via spaced repetition, track your progress, build learning roadmaps, find resources, take notes, summarize topics, and test your knowledge. ## Commands | Command | Description | |---------|-------------| | `learn <topic> [hours]` | Start a learning session on a topic with optional time estimate | | `quiz <topic>` | Run a quick 3-question quiz on a topic | | `flashcard <term>` | Create a flashcard with a front term (answer saved to data dir) | | `review` | Launch a spaced repetition review session (1d, 3d, 7d, 14d, 30d intervals) | | `progress` | Show total number of logged study sessions | | `roadmap` | Generate a multi-week learning roadmap (basics → practice → projects) | | `resource` | List resource categories: books, videos, courses, practice sites | | `note <text>` | Save a timestamped note to the data log | | `summary <topic>` | Get a summary of a topic | | `test <topic>` | Self-test your knowledge on a topic | | `help` | Show all available commands and usage info | | `version` | Display current version (v2.0.0) | ## Data Storage All data is stored locally in `$TRIVIA_QUIZ_DIR` (defaults to `~/.local/share/trivia-quiz/`): - **`data.log`** — Notes and general entries saved with `note` command - **`history.log`** — Timestamped log of every command executed (learn, quiz, flashcard, etc.) The data directory is created automatically on first run. No cloud sync — everything stays on your machine. ## Requirements - **Bash** ≥ 4.0 (uses `set -euo pipefail`) - **coreutils** — `date`, `wc`, `mkdir` (standard on Linux/macOS) - No API keys, no internet connection, no external dependencies ## When to Use 1. **Self-study sessions** — Use `learn` and `roadmap` to structure your study of a new programming language, framework, or any topic 2. **Exam prep** — Use `quiz` and `test` to drill yourself, then `review` for spaced repetition before an exam 3. **Daily flashcard habit** — Use `flashcard` to build a deck and `review` to maintain a daily spaced repetition routine 4. **Meeting/lecture notes** — Use `note` to quickly capture timestamped insights during a meeting, class, or conference talk 5. **Learning progress tracking** — Use `progress` to see how many sessions you've logged and stay motivated over time ## Examples ```bash # Start learning a topic with estimated time trivia-quiz learn python 2 # Run a quick quiz on Docker trivia-quiz quiz docker # Create a flashcard trivia-quiz flashcard "What is a closure?" # Review with spaced repetition trivia-quiz review # Check how many sessions you've completed trivia-quiz progress # Generate a learning roadmap trivia-quiz roadmap # Find study resources trivia-quiz resource # Save a quick note trivia-quiz note "Remember: Python decorators are syntactic sugar for higher-order functions" # Get a topic summary trivia-quiz summary kubernetes # Self-test on a topic trivia-quiz test algorithms # Show help trivia-quiz help ``` ## Tips - Combine `learn` → `note` → `quiz` → `review` for a complete study cycle - Use `roadmap` at the start of a new subject to plan your weeks - Check `progress` regularly to maintain accountability - All history is logged — you can `grep` through `~/.local/share/trivia-quiz/history.log` for past activity --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/script.sh #!/usr/bin/env bash # trivia-quiz - Learning and study assistant set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/trivia-quiz}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF trivia-quiz v$VERSION Learning and study assistant Usage: trivia-quiz <command> [args] Commands: learn Start learning quiz Quick quiz flashcard Flashcards review Review session progress Track progress roadmap Learning roadmap resource Find resources note Take note summary Topic summary test Self test help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_learn() { echo " Topic: $1 Estimated: -1 hour" _log "learn" "-" } cmd_quiz() { echo " Q1: What is $1? Q2: How does $1 work? Q3: When to use $1?" _log "quiz" "-" } cmd_flashcard() { echo " Front: $1 Back: [answer] Saved to $DATA_DIR" _log "flashcard" "-" } cmd_review() { echo " Review: spaced repetition (1d, 3d, 7d, 14d, 30d)" _log "review" "-" } cmd_progress() { echo " Sessions: $(wc -l < "$DB" 2>/dev/null || echo 0)" _log "progress" "-" } cmd_roadmap() { echo " 1. Basics (week 1-2) 2. Practice (week 3-4) 3. Projects (week 5+)" _log "roadmap" "-" } cmd_resource() { echo " Books | Videos | Courses | Practice sites" _log "resource" "-" } cmd_note() { echo "$(date) | $*" >> "$DB"; echo " Noted: $*" _log "note" "-" } cmd_summary() { echo " Summary of: $1" _log "summary" "-" } cmd_test() { echo " Testing knowledge of: $1" _log "test" "-" } case "-help" in learn) shift; cmd_learn "$@" ;; quiz) shift; cmd_quiz "$@" ;; flashcard) shift; cmd_flashcard "$@" ;; review) shift; cmd_review "$@" ;; progress) shift; cmd_progress "$@" ;; roadmap) shift; cmd_roadmap "$@" ;; resource) shift; cmd_resource "$@" ;; note) shift; cmd_note "$@" ;; summary) shift; cmd_summary "$@" ;; test) shift; cmd_test "$@" ;; help|-h) show_help ;; version|-v) echo "trivia-quiz v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/trivia.sh #!/usr/bin/env bash set -euo pipefail CMD="-help"; shift 2>/dev/null || true; INPUT="$*" python3 -c ' import sys,hashlib from datetime import datetime cmd=sys.argv[1] if len(sys.argv)>1 else "help" inp=" ".join(sys.argv[2:]) QS=[("What is the capital of Australia?","Canberra"),("How many planets in our solar system?","8"),("What year did the Titanic sink?","1912"),("What is the largest ocean?","Pacific"),("How many bones in the human body?","206"),("What is the speed of light?","~300,000 km/s"),("Who painted the Mona Lisa?","Leonardo da Vinci"),("What is the smallest country?","Vatican City"),("What gas do plants absorb?","Carbon dioxide (CO2)"),("How many continents are there?","7"),("What is the longest river?","Nile (~6,650 km)"),("What element has symbol Au?","Gold"),("Who wrote Romeo and Juliet?","William Shakespeare"),("What is the boiling point of water?","100C / 212F"),("What planet is known as Red Planet?","Mars")] if cmd=="play": count=int(inp) if inp and inp.isdigit() else 5 seed=int(hashlib.md5(datetime.now().strftime("%Y%m%d%H%M").encode()).hexdigest()[:8],16) print(" Trivia Quiz ({} questions):".format(count)) print("") for i in range(count): idx=(seed+i*7)%len(QS) q,a=QS[idx] print(" Q{}: {}".format(i+1,q)) print(" A{}: {}".format(i+1,a)) print("") elif cmd=="categories": print(" Categories: General Knowledge, Science, Geography, History, Arts") elif cmd=="help": print("Trivia Quiz\n play [count] — Generate quiz questions\n categories — List categories") else: print("Unknown: "+cmd) print("\nPowered by BytesAgain | bytesagain.com") ' "$CMD" $INPUT FILE:tips.md # Trivia Quiz - tips.md ## Quick Reference
吐槽生成器。温和吐槽、毒舌模式、朋友互怼、名人吐槽、自嘲、Battle模式。Roast generator with gentle, savage modes. 吐槽、毒舌、搞笑。
--- version: "2.0.0" name: Roast Generator description: "Roast Generator. Use when you need roast generator capabilities. Triggers on: roast generator." 吐槽生成器。温和吐槽、毒舌模式、朋友互怼、名人吐槽、自嘲、Battle模式。Roast generator with gentle, savage modes. 吐槽、毒舌、搞笑。 author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Roast Generator 吐槽生成器。温和吐槽、毒舌模式、朋友互怼、名人吐槽、自嘲、Battle模式。Roast generator with gentle, savage modes. 吐槽、毒舌、搞笑。 ## 常见问题 **Q: 这个工具适合谁用?** A: 任何需要roast generator的人,无论是个人还是企业用户。 **Q: 输出格式是什么?** A: 主要输出Markdown格式,方便复制和编辑。 ## 命令速查 ``` gentle gentle savage savage friend friend celebrity celebrity self self battle battle ``` --- *Roast Generator by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com - Run `roast-generator help` for all commands ## Commands Run `roast-generator help` to see all available commands. ## Output Results go to stdout. Save with `roast-generator run > output.txt`. ## Output Results go to stdout. Save with `roast-generator run > output.txt`. FILE:scripts/roast.sh #!/usr/bin/env bash set -euo pipefail CMD="-help"; shift 2>/dev/null || true; INPUT="$*" python3 -c ' import sys,hashlib from datetime import datetime cmd=sys.argv[1] if len(sys.argv)>1 else "help" inp=" ".join(sys.argv[2:]) ROASTS={"programmer":["Your code has more bugs than a dumpster behind Dennys.","You write spaghetti code and call it architecture.","Git blame always points to you.","Your commit messages are just keyboard smashes.","You use Stack Overflow so much they should charge you rent."],"general":["You bring everyone so much joy... when you leave.","I would explain it to you but I ran out of crayons.","You are the reason they put instructions on shampoo.","Somewhere out there, a tree is producing oxygen for you. Apologize to it.","If you were any more laid back, you would be horizontal."],"friend":["You are the human equivalent of a participation trophy.","I am not saying you are boring, but your autobiography would be one page.","You are proof that evolution can go in reverse.","If personalities had calories, you would be a rice cake.","Your WiFi personality: always connected, never strong."]} if cmd=="generate": cat=inp.lower() if inp and inp in ROASTS else "general" seed=int(hashlib.md5(datetime.now().strftime("%S%M%H").encode()).hexdigest()[:8],16) pool=ROASTS[cat] print(" {}".format(pool[seed%len(pool)])) print("\n (All in good fun! Never use to actually hurt someone.)") elif cmd=="category": for c in ROASTS: print(" {} ({} roasts)".format(c,len(ROASTS[c]))) elif cmd=="help": print("Roast Generator\n generate [programmer|general|friend] — Random roast\n category — List categories") else: print("Unknown: "+cmd) print("\nPowered by BytesAgain | bytesagain.com\nAll in good fun!") ' "$CMD" $INPUT FILE:scripts/script.sh #!/usr/bin/env bash # roast-generator - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/roast-generator}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF roast-generator v$VERSION Multi-purpose utility tool Usage: roast-generator <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "roast-generator v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Roast Generator - tips.md ## Quick Reference