/slack-formatter:slack-formatter [path-to-markdown-file]from slack-formatter
Converts markdown to rich HTML and copies it to the macOS clipboard for pasting into Slack with formatting (bold, lists, code blocks, headings) preserved.
Ships in slack-formatter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Convert markdown to rich text and place it in the macOS clipboard so the user can Cmd+V it into Slack with formatting preserved.
Trigger automatically when the user:
Do not invoke when the user asks for plain text only (tldrpr already covers that case).
Parse $ARGUMENTS:
If a file path is passed — use that file.
Otherwise — use the most recent drafted markdown content from the conversation context (a reply, message, summary). Write it to a temp file first:
TMPFILE=$(mktemp -t slackfmt).md
# write conversation-drafted markdown here via Write tool
If no draft is available and no path given — ask the user what text to format.
Require pandoc (install via Homebrew if missing: brew install pandoc). Swift is already shipped with macOS.
Run this block, substituting $MDFILE with the resolved input path:
MDFILE="${1:?markdown file required}"
HTMLFILE="${MDFILE%.md}.html"
command -v pandoc >/dev/null || { echo "pandoc not found — brew install pandoc" >&2; exit 1; }
pandoc -f gfm -t html "$MDFILE" -o "$HTMLFILE" || exit 1
SWIFT_SCRIPT=$(mktemp -t slackfmt).swift
cat > "$SWIFT_SCRIPT" <<'SWIFT'
import AppKit
import Foundation
guard CommandLine.arguments.count >= 3 else {
FileHandle.standardError.write("usage: pbcopy_html <htmlfile> <plainfile>\n".data(using: .utf8)!)
exit(2)
}
guard let html = try? String(contentsOfFile: CommandLine.arguments[1], encoding: .utf8),
let plain = try? String(contentsOfFile: CommandLine.arguments[2], encoding: .utf8) else {
FileHandle.standardError.write("cannot read input files\n".data(using: .utf8)!)
exit(1)
}
let pb = NSPasteboard.general
pb.clearContents()
pb.setString(html, forType: .html)
pb.setString(plain, forType: .string)
print("OK: html=\(html.count) bytes, plain=\(plain.count) bytes")
SWIFT
swift "$SWIFT_SCRIPT" "$HTMLFILE" "$MDFILE"
rm -f "$SWIFT_SCRIPT" "$HTMLFILE"
After successful copy, confirm to the user with:
Cmd+V — do NOT use Cmd+Shift+V (that pastes plain text and drops formatting)."pbpaste will only show the plain-text fallback — this is normal. The HTML part is in the clipboard under «class HTML», which is what Slack reads.osascript -e 'clipboard info' if the user reports pasting issues. Expected output includes both «class HTML» and «class utf8».## headings become bold text, nested lists flatten in predictable ways, fenced code blocks keep monospace font, tables become tab-separated plain text.-f gfm) handles GitHub-style fenced code blocks with language hints and task lists correctly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lexfrei/ccc --plugin slack-formatterOther plugins' skills for the same job