Skip to main content

clipboard

Copy text to clipboard with optional rich formatting. Triggers on "copy to clipboard", "copy that", "pbcopy", "copy formatted", "copy rich text".

Source facts

Repository
CodeAlive-AI/clipboard-skill
Last source activity
February 26, 2026 at 21:21
Detected SKILL.md language
English
Stars
1
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
clipboard
description
Copy text to clipboard with optional rich formatting. Triggers on "copy to clipboard", "copy that", "pbcopy", "copy formatted", "copy rich text".
# Clipboard Copy the most recent relevant text block from the conversation to the macOS system clipboard. ## Plain Text Copy (Default) Use a heredoc to safely handle special characters (quotes, apostrophes, backticks, dollar signs): ```bash cat <<'CLIPBOARD' | pbcopy <text to copy> CLIPBOARD ``` ## Rich Text Copy (Formatted) Use when the user wants formatting preserved for pasting into Slack, Word, Google Docs, Notion, etc. Sets both HTML and plain text on the clipboard via Swift, so the receiving app picks the richest format it supports. **Step 1:** Write the HTML content to a temp file: ```bash cat <<'CLIPBOARD_HTML' > /tmp/_clipboard_rich.html <html><body> <h2>Title</h2> <p>Paragraph with <b>bold</b> and <i>italic</i>.</p> <ul><li>Item one</li><li>Item two</li></ul> </body></html> CLIPBOARD_HTML ``` **Step 2:** Write the plain text fallback to a temp file: ```bash cat <<'CLIPBOARD_TEXT' > /tmp/_clipboard_rich.txt Title Paragraph with bold and italic. - Item one - Item two CLIPBOARD_TEXT ``` **Step 3:** Set clipboard with both HTML and plain text using Swift: ```bash swift -e ' import AppKit let html = try Data(contentsOf: URL(fileURLWithPath: "/tmp/_clipboard_rich.html")) let text = try String(contentsOfFile: "/tmp/_clipboard_rich.txt", encoding: .utf8) let pb = NSPasteboard.general pb.clearContents() pb.setData(html, forType: .html) pb.setString(text, forType: .string) ' ``` **Step 4:** Clean up temp files: ```bash rm -f /tmp/_clipboard_rich.html /tmp/_clipboard_rich.txt ``` ## When to Use Rich vs Plain - **Rich**: User says "copy formatted", "copy as rich text", "copy for Word/Stripe/Docs", or the content has meaningful formatting (tables, bold, headers, lists, code blocks) - **Plain**: Default for code snippets, terminal output, simple text, or when user says "copy to clipboard" without formatting context ## Rules 1. Identify the most recent text block the user wants copied (message, code block, drafted text, etc.) 2. If ambiguous, ask what to copy 3. Use single-quoted heredoc delimiters (`'CLIPBOARD'`, `'CLIPBOARD_HTML'`, `'CLIPBOARD_TEXT'`) to prevent shell expansion 4. For rich copy, convert markdown-style content to proper HTML (use `<b>`, `<i>`, `<code>`, `<table>`, `<ul>/<li>`, `<h1>`-`<h6>`, `<pre>`, etc.) 5. Always provide a plain text fallback alongside HTML 6. Confirm success after copying, noting whether plain or rich format was used
View on GitHub