Skip to content

davepoon/buildwithclaude / plugins/all-skills/skills/ctrl-clip

ctrl-clip

Verified

⧉ Copy a message to the system clipboard cleanly formatted — no blockquote pipes, no terminal bars, no Claude commentary. Use whenever you draft a message the user will paste (Slack, Teams, PR comment, email) to add a clickable "⧉ ctrl + click" copy link under it, and when the user says "/ctrl-clip", "copy that", "put it on the clipboard" (in any language). Optional argument picks the target format: slack (default), md, plain.

FileKindSize
SKILL.mdskill md4.8 KB
clip-setup.shexecutablescript8.3 KB
clip-url-handler.shexecutablescript925 B
clip.shexecutablescript1.8 KB
#!/usr/bin/env bash
# Copy a text file (or stdin) to the system clipboard, stripping terminal/markdown
# artifacts that paste badly: blockquote markers, box-drawing bars, Claude bullets.
set -euo pipefail

input=$(if [[ $# -gt 0 ]]; then cat -- "$1"; else cat; fi)

clean=$(printf '%s\n' "$input" \
  | sed -E \
      -e 's/^[[:space:]]*(>[[:space:]]?)+//' \
      -e 's/^[[:space:]]*(│|┃|▎|▍|▌|⎿|⏺)[[:space:]]?//' \
      -e 's/[[:space:]]+$//' \
  | cat -s \
  | sed -e '/./,$!d' \
  | sed -e ':a' -e '/^\n*$/{$d;N;ba' -e '}')

copy_with_osc52() {
  local pid=$$ tty
  while [[ "$pid" -gt 1 ]]; do
    tty=$(ps -o tty= -p "$pid" | tr -d ' ')
    if [[ -n "$tty" && "$tty" != "?" && "$tty" != "??" ]]; then
      printf '\033]52;c;%s\a' "$(printf '%s' "$clean" | base64 | tr -d '\n')" > "/dev/$tty"
      return 0
    fi
    pid=$(ps -o ppid= -p "$pid" | tr -d ' ')
  done
  return 1
}

# X11/Wayland backends fork a process that keeps owning the selection. Detach its stdout
# and stderr, or anything reading our output ($(…), a pipe) waits until that process exits.
copy_with() {
  if ! printf '%s' "$clean" | "$@" >/dev/null 2>&1; then
    echo "clip: $1 could not copy to the clipboard" >&2
    exit 1
  fi
}

if [[ -n "${WAYLAND_DISPLAY:-}" ]] && command -v wl-copy >/dev/null; then
  copy_with wl-copy
elif [[ -n "${DISPLAY:-}" ]] && command -v xclip >/dev/null; then
  copy_with xclip -selection clipboard -i
elif [[ -n "${DISPLAY:-}" ]] && command -v xsel >/dev/null; then
  copy_with xsel --clipboard --input
elif command -v pbcopy >/dev/null; then
  copy_with pbcopy
elif ! copy_with_osc52; then
  echo "clip: no clipboard backend available (wl-copy, xclip, xsel, pbcopy, OSC 52)" >&2
  exit 1
fi

lines=$(printf '%s\n' "$clean" | wc -l | tr -d ' ')
chars=$(printf '%s' "$clean" | wc -m | tr -d ' ')
echo "⧉ Copied ${lines} lines / ${chars} chars"
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