clean-copy — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited clean-copy (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Clean a draft from the conversation (or a pasted/file source) and copy it to the clipboard, formatted for a specific platform. The goal: a paste that looks right in Gmail / Slack / LinkedIn on the first try, with zero manual cleanup.
Before starting, use the Read tool to read ~/.claude/skills/clean-copy/preferences.md. If the file does not exist, treat as "no preferences set" and use defaults below.
Defaults:
gmaillast (most recent assistant draft in the conversation)true (rewrap soft-wrapped paragraphs into single lines)- (preserve as-is)true (show first 12 lines + char count)Check $ARGUMENTS:
~/.claude/skills/clean-copy/preferences.md, confirm, stopClean Copy — Clean terminal-formatted text and copy to clipboard for a target platform
Usage:
/clean-copy <platform> Clean latest draft, format, pbcopy
/clean-copy Use default platform from preferences
/clean-copy config Set defaults (default platform, reflow, etc.)
/clean-copy reset Clear preferences
/clean-copy help This help
Platforms:
gmail Plain prose, bullets as "- ", no markdown rendering
slack Slack mrkdwn: *bold*, _italic_, `code`, > quotes
linkedin Plain prose, no markdown (LinkedIn strips it), short paragraphs
plain Strip all markdown, just clean prose
markdown Preserve markdown, only clean terminal whitespace
Options:
--source last Latest assistant draft in conversation (default)
--source paste Prompt the user to paste the source text
--source file:<path> Read source from a file
--no-reflow Keep hard line breaks as-is (don't unwrap paragraphs)
--preview Show full cleaned text before copying
Examples:
/clean-copy gmail Clean my last draft for Gmail compose
/clean-copy slack Format for Slack mrkdwn
/clean-copy linkedin --no-reflow Keep my line breaks (poetry / structured posts)
/clean-copy plain --source paste I'll paste the messy text after invocation
/clean-copy markdown --source file:/tmp/draft.md
Current preferences:
(loaded from preferences.md, or defaults shown above)Use AskUserQuestion to collect:
gmail, slack, linkedin, plain, or markdown. The platform used when /clean-copy is invoked with no platform arg.Yes (recommended for prose) or No (preserve hard line breaks). Reflow joins soft-wrapped lines into single paragraphs separated by blank lines.- (keep as written), • (convert to bullet glyph), or * (asterisk). Affects how list items render after cleaning.Yes (show first 12 lines + char count) or No (silent except for "Copied").Save to ~/.claude/skills/clean-copy/preferences.md in this format:
# /clean-copy preferences
Updated: <date>
## Defaults
- default-platform: gmail
- reflow-paragraphs: true
- bullet-style: -
- preview-after-copy: true
## Learned
- (patterns observed silently, e.g., "user always picks slack on weekdays mornings")Delete ~/.claude/skills/clean-copy/preferences.md and confirm: "Preferences cleared. Using defaults."
If no preferences file exists, show:
First time using /clean-copy? Run /clean-copy config to set defaults, or just continue — defaults are gmail / reflow on / dash bullets.Then proceed.
Parse $ARGUMENTS:
gmail, slack, linkedin, plain, markdown) is present, use it.default-platform from preferences (or gmail).Check for --source flag in $ARGUMENTS:
paste mode.<path> with the Read tool. If it doesn't exist, abort with a clear error.If multiple plausible drafts are in the conversation, pick the most recent one and say "Using your most recent draft (~N words). Run /clean-copy <platform> --source paste to override."
Apply these passes in order. Each pass is non-destructive of meaning — only whitespace and terminal artifacts.
\r\n and \r to \n.│, ─, ┃, or trailing block characters at the right edge. Drop them.If --no-reflow is set OR the source contains fenced code blocks where line breaks matter, skip this step for those sections.
For prose paragraphs, rejoin soft-wrapped lines:
., !, ?, :, ;, …) AND the next line exists, is non-empty, is not a list item (-, *, 1.), is not a heading (#), and is not blockquote (>).This is the most important pass for terminal output: a paragraph wrapped at 80 columns becomes one long line, which Gmail / Slack / LinkedIn will then re-wrap correctly for their own width.
Apply platform-specific transforms after cleaning:
`gmail` (rich compose, but markdown is NOT rendered):
**bold** → bold, *italic* → italic, __bold__ → bold, _italic_ → italic.# H1 / ## H2 → drop the #s and surrounding hashes; keep the text on its own line. Do NOT bold (Gmail won't render).- item (Gmail compose recognizes and renders these as proper bullets when you press Enter inside the editor on the next line; pasting - lines is fine). ` , keep content as-is (monospace is lost, that's expected). code → code` (drop backticks).[text](url) → text (url) so the URL is visible.`slack` (mrkdwn — different from CommonMark):
**bold** → *bold* (single asterisk).*italic* or _italic_ → _italic_.~~strike~~ → ~strike~.# H1 → *H1* on its own line (slack has no real headings; bold is the convention).- item or convert to • item per bullet-style preference. Slack renders both.> quote lines kept as-is (slack renders them). ` ) kept as-is — Slack supports them.[text](url) → <url|text> (slack format).`linkedin` (no markdown rendering, anywhere):
- item lines (LinkedIn doesn't auto-format but plain dashes are conventional).[text](url) → text: url (or just url on its own line if text is the same).`plain`:
text).- item.`markdown`:
/tmp/clean-copy-output.txt using the Write tool. Use the Write tool, not echo, to avoid quoting issues with special characters in the draft.pbcopy < /tmp/clean-copy-output.txtpbpaste | wc -c and confirm the byte count is non-zero and roughly matches the source.If preview-after-copy is true (default) OR --preview flag is set:
✓ Copied to clipboard — formatted for {platform} ({char_count} chars, {line_count} lines)
>
`` {first 12 lines of cleaned output} ... ``>
Source: {last assistant draft / pasted / file:path} Cleaning: stripped {N}-space indent, reflowed {M} soft wraps, dropped {K} trailing-whitespace lines
If preview is off, just:
✓ Copied for {platform} ({char_count} chars).
Watch for silent corrections:
/clean-copy (no platform), then immediately reruns with a specific platform → save that as the new default-platform.--no-reflow two times in a row → flip reflow-paragraphs to false./clean-copy plain repeatedly when their default is gmail → consider suggesting a default change after 3 occurrences.When something is learned, mention it once: "Noted: you've picked slack three times in a row — want me to make that the default? (/clean-copy config to change.)"
pbcopy. Always end with a fresh clipboard the user can paste immediately. Never just print./tmp/clean-copy-output.txt first, then pbcopy from the file. Avoids quoting hell from inline shell strings with quotes / backticks / unicode.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.