{"id":"paste","name":"paste","summary":"Slack、Notion、Twitter/X、LinkedIn、メール、GitHub、またはプレーンテキストに貼り付けるために、通常は端末からコンテンツをクリーンアップ・再フォーマットしたい場合です。","body":"# /paste — Clean content for any destination\n\nCleans terminal output (ANSI, box-drawing, prompt artifacts, etc.) and reformats per destination rules. Reads clipboard by default, writes back to clipboard + previews in chat.\n\n## Step 1 — Get the content\n\nIn order:\n1. If the user included content in the prompt (pasted, or referenced from earlier in the conversation), use that.\n2. Else, read clipboard: `pbpaste`\n3. If both empty, ask the user what to paste.\n\n## Step 2 — Parse destination\n\n| Invocation | Destination |\n|---|---|\n| `/paste` | **plain** (default) |\n| `/paste plain` | plain |\n| `/paste slack` | slack |\n| `/paste notion` | notion |\n| `/paste twitter` or `/paste x` | twitter |\n| `/paste linkedin` or `/paste li` | linkedin |\n| `/paste email` | email (plain) |\n| `/paste email rich` or `/paste email html` | email (rich/HTML) |\n| `/paste github` or `/paste gh` | github |\n| `/paste markdown` or `/paste md` | markdown render |\n| `/paste html` | render to HTML file + open in browser |\n\nIf ambiguous, ask. Per-destination rules live in `references/destinations.md`.\n\n## Step 3 — Scan for secrets\n\nBefore any cleaning or copying, scan against patterns in `references/secret-patterns.md`.\n\nIf any match:\n1. **Stop.** Don't copy yet.\n2. Report what was detected with the value **masked** (first 4 + last 4 chars only — e.g. `sk-12...wxyz`).\n3. Ask: *\"Spotted [type] in the content. Continue, redact (replace with `[REDACTED]`), or abort?\"*\n4. Default to **abort** if no clear answer.\n\n## Step 4 — Universal cleaning\n\nStrip from the content:\n\n- **ANSI escape codes** — `\\x1b\\[[0-9;]*[a-zA-Z]` and related (color codes, cursor movement, screen control)\n- **Box-drawing chars** — `╭ ─ ╮ │ ╰ ╯ ╞ ╡ ╤ ╧ ┌ ┐ └ ┘ ├ ┤ ┬ ┴ ┼ ━ ┃ ┏ ┓ ┗ ┛` etc. Replace with simpler equivalents (`-`, `|`) or remove entirely depending on context.\n- **Terminal prompt artifacts** — leading `$ `, `> `, `❯ `, `% `, `# ` (when first non-whitespace on a line that looks like a shell prompt)\n- **Carriage returns** (`\\r`) — replace with `\\n` or delete\n- **Trailing whitespace** per line\n- **Excess blank lines** — collapse 3+ consecutive blank lines to 2\n\n## Step 5 — Apply destination rules\n\nRead `references/destinations.md` and apply the relevant transform.\n\n## Step 6 — Output\n\n| Destination | Output behavior |\n|---|---|\n| plain / slack / notion / twitter / linkedin / email / github | (a) Show preview in a code fence in chat. (b) Copy clean version to clipboard via `pbcopy`. |\n| email rich | Render to HTML, write to `/tmp/paste-<timestamp>.html`, `open` it in browser. Skip clipboard (the user copies from browser to preserve rich text). |\n| markdown | Render the cleaned markdown directly in chat (Claude Code renders it). Also copy raw markdown to clipboard. Offer: *\"Open as HTML too?\"* — if yes, write and open. |\n| html | Render to HTML, write to `/tmp/paste-<timestamp>.html`, `open` it. Skip clipboard. |\n\nAfter output, report a one-line summary of what was cleaned (e.g., *\"Stripped 12 ANSI codes, 4 box-drawing chars, 1 prompt artifact. Character count: 248 / 280 (X).\"*).\n\n## Length warnings\n\nTwitter and LinkedIn have practical limits. the user said \"let me trim\" — don't refuse or auto-truncate.\n\n- **Twitter/X**: warn if >280 chars. Note the overage.\n- **LinkedIn**: warn if >400 chars (comfort line, not hard limit).\n- Other destinations: no length warning.\n\n## URL handling for social destinations\n\nIf the content has URLs and destination is **twitter** or **linkedin**:\n- Surface the URLs separately (don't include them in the body)\n- Remind the user: links go in a first comment (LinkedIn) or reply (X), not the body\n- See `makerskills:jab-hook` and `~/.claude/memory/feedback_social_link_placement.md`\n\n## Examples\n\n```\n/paste slack\n```\n→ Reads clipboard, strips ANSI, converts `**bold**` to `*bold*`, copies to clipboard, shows preview.\n\n```\n/paste twitter\n[pasted error log]\n```\n→ Uses pasted content (ignores clipboard), strips everything, warns at 412/280 chars, copies, asks if the user wants to trim or pick a different destination.\n\n```\n/paste html\n[pasted markdown table]\n```\n→ Renders table as HTML, opens in browser. the user selects + copies into Notion/email with formatting preserved.\n\n```\n/paste\n[pasted output with sk-anthropic-key in it]\n```\n→ Stops. *\"Spotted what looks like an Anthropic API key: `sk-an...3kf9`. Continue, redact, or abort?\"*\n\n## Composes with\n\n- `jab-hook` — clean output for pasting into Typefully drafts when the MCP path doesn't fit; also enforces the link-placement rule for X/LinkedIn destinations\n- `social-fetch` — clean a fetched post before quoting it in a draft or newsletter\n- `second-brain` — `paste` output can be captured cleanly into `raw/note-<slug>.md` for future compilation\n- `watch-video` — transcript / summary output often flows through `paste` for platform-specific reformatting\n\n## Notes on quality\n\n- **Secret detection runs first, always.** Before any formatting or destination logic, `paste` scans for `sk-*`, `AKIA*`, `xoxb-*`, JWT-shaped strings, and long-hex tokens. Prompts before proceeding on any hit. Better to false-positive occasionally than to leak a real key.\n- **Destination-aware transforms, not one-size-fits-all.** Slack wants `*bold*`; LinkedIn wants unicode-styled bold; email wants HTML. Same input, 9 different valid outputs. The destination flag is not optional.\n- **ANSI codes get stripped for every destination.** Terminal escapes (`\\033[31m` etc.) render as garbage everywhere except the source terminal.\n- **Character limits are enforced, not warnings.** X at 280, LinkedIn at 3000, Twitter at 25000 — paste refuses to copy over-limit output and offers a trim strategy.\n- **Links go in first comments for social destinations** — not the body. Enforced when destination is `twitter` or `linkedin`. Documented in `~/.claude/memory/feedback_social_link_placement.md`.\n- **HTML destination opens in a browser tab, not the clipboard.** Formatted tables + code blocks need a rendered surface to select-and-copy from with formatting preserved. Copying raw HTML to the clipboard produces garbage in Notion/email.","author":"@coreyhaines31","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/coreyhaines31/makerskills/tree/main/skills/paste","license":"MIT","category":"writing","lang":"en","tokens":1598,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"references/destinations.md","size":4982,"sha256":"22ceadbd8bd9fff3686ec46a79baec463e06787912c9e4aaeed7cc2f2db2ff3b"},{"path":"references/secret-patterns.md","size":3105,"sha256":"cb02b94260fffcff4abda97c739a1bae8edcf3447f42976ef1013e534d72859b"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":["hooks.slack.com"]}}