Skip to content

aspiers/ai-config / .agents/skills/submitting-upstream

submitting-upstream

Verified

Prepare and publish upstream issues, feature requests, discussions, pull or merge requests, and patch submissions in the channel the canonical project expects. Use when reporting a problem upstream, requesting a feature, contributing a change, or asking to submit upstream.

FileKindSize
SKILL.mdskill md8.0 KB
reference/manual-web-form-submission.mdmarkdown5.5 KB
scripts/paste-form-fields.shexecutablescript3.7 KB

scripts/paste-form-fields.sh

View on GitHub
#!/usr/bin/env bash
# Walk the user through a web form one field at a time: load each text field
# onto the clipboard, announce every field with a desktop notification that
# names it, and advance on a timer so the user never has to report back.
#
# Usage: paste-form-fields.sh [-f FIRST_DELAY] [-d DELAY] [-t DISPLAY_SECS] FILE...
#
# The field label comes from the filename: 2-problem-or-use-case.txt becomes
# "Problem or use case". A first line of "#NOTE: text" is shown in the
# notification and not copied. A file holding only that line announces a field
# to set by hand, such as a checkbox or dropdown, and leaves the clipboard alone.
set -euo pipefail

first_delay=5
delay=5
display_secs=10

usage() {
    echo "usage: ${0##*/} [-f FIRST_DELAY] [-d DELAY] [-t DISPLAY_SECS] FILE..." >&2
    exit 2
}

while getopts 'f:d:t:h' opt; do
    case $opt in
        f) first_delay=$OPTARG ;;
        d) delay=$OPTARG ;;
        t) display_secs=$OPTARG ;;
        *) usage ;;
    esac
done
shift $((OPTIND - 1))
(($# > 0)) || usage

if [[ -n ${WAYLAND_DISPLAY:-} ]] && command -v wl-copy >/dev/null; then
    clip_in() { wl-copy; }
    clip_out() { wl-paste -n; }
elif [[ -n ${DISPLAY:-} ]] && command -v xclip >/dev/null; then
    clip_in() { xclip -selection clipboard; }
    clip_out() { xclip -selection clipboard -o; }
elif [[ -n ${DISPLAY:-} ]] && command -v xsel >/dev/null; then
    clip_in() { xsel --clipboard --input; }
    clip_out() { xsel --clipboard --output; }
elif command -v pbcopy >/dev/null; then
    clip_in() { pbcopy; }
    clip_out() { pbpaste; }
else
    echo "no clipboard tool found (wl-copy, xclip, xsel or pbcopy)" >&2
    exit 1
fi

if command -v notify-send >/dev/null; then
    notify() { notify-send -t $((display_secs * 1000)) "$1" "$2"; }
elif command -v osascript >/dev/null; then
    # Why: macOS decides how long a notification stays up; -t cannot apply.
    notify() {
        osascript - "$1" "$2" <<'EOF'
on run argv
    display notification (item 2 of argv) with title (item 1 of argv)
end run
EOF
    }
else
    echo "warning: no notification tool; announcing in this terminal only" >&2
    notify() { :; }
fi

field_label() {
    local name
    name=$(basename "$1" .txt)
    name=${name#*-}
    name=${name//-/ }
    # Why not ${name^}: macOS still ships bash 3.2.
    printf '%s%s' "$(printf '%s' "${name:0:1}" | tr '[:lower:]' '[:upper:]')" "${name:1}"
}

total=$#
i=0
for file in "$@"; do
    i=$((i + 1))
    label=$(field_label "$file")
    note=''
    content=$(cat "$file")
    if [[ $content == '#NOTE: '* ]]; then
        note=${content%%$'\n'*}
        note=${note#'#NOTE: '}
        content=${content#"#NOTE: $note"}
        content=${content#$'\n'}
    fi

    if [[ -z $content ]]; then
        if [[ -z $note ]]; then
            echo "$file is empty; give it a #NOTE: line saying what to set" >&2
            exit 1
        fi
        # Why: checkboxes and dropdowns take a click, so the clipboard keeps the last paste.
        body="$label: $note"
    else
        # Why printf '%s': a trailing newline lands in the form as a stray blank line.
        printf '%s' "$content" | clip_in
        # Why: a silent copy failure would mean pasting stale text into a public tracker.
        if [[ $(clip_out) != "$content" ]]; then
            notify "Paste aborted" "Clipboard check failed for $label"
            echo "clipboard mismatch for $file" >&2
            exit 1
        fi
        body="Paste into: $label"
        [[ -n $note ]] && body+=" — $note"
    fi
    echo "$(date +%T) [$i/$total] $label"

    if ((i == total)); then
        notify "Field $i/$total ready (last)" "$body"
        break
    fi
    wait_s=$delay
    ((i == 1)) && wait_s=$first_delay
    notify "Field $i/$total ready, next in ${wait_s}s" "$body"
    sleep "$wait_s"
done
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall