md-copy
npx machina-cli add skill umputun/cc-thingz/md-copy --openclawMarkdown Copy
Extract the final answer from this session, convert it to proper markdown format, and copy to clipboard.
Formatting Rules
- No heading elements (
#,##, etc.) — use bold for section titles instead - Convert any ASCII tables to proper markdown tables
- Use italic for emphasis and minor notes
- Preserve code blocks with proper language tags
- Keep bullet lists and numbered lists
- Remove any leading spaces or bullet headers (bullet-style)
- Give the content a nice descriptive title (as bold text, not heading)
Workflow
- Identify the final answer/response in this session
- Format it according to the rules above
- Write formatted text to a timestamped temp file:
tmpfile="/tmp/claude-md-copy-$(date +%s).txt"
cat > "$tmpfile" << 'EOF'
<formatted content>
EOF
- Copy to clipboard and remove temp file:
if [[ "$OSTYPE" == "darwin"* ]]; then
pbcopy < "$tmpfile"
elif command -v xclip &> /dev/null; then
xclip -selection clipboard < "$tmpfile"
elif command -v xsel &> /dev/null; then
xsel --clipboard --input < "$tmpfile"
else
echo "No clipboard tool found" >&2
fi
rm -f "$tmpfile"
- Report success with character count
Source
git clone https://github.com/umputun/cc-thingz/blob/master/plugins/workflow/skills/md-copy/SKILL.mdView on GitHub Overview
md-copy formats the session final answer into clean Markdown according to explicit rules and copies it to the clipboard. It removes heading elements, uses bold for section titles, converts ASCII tables to proper Markdown tables, italicizes emphasis, preserves code blocks with language tags, and keeps lists. The process writes to a timestamped temp file and reports the character count on success.
How This Skill Works
It identifies the final answer in the conversation, applies the formatting rules like bold titles, italic emphasis, table conversion, and code block preservation, then writes the formatted content to a timestamped temp file in /tmp. It copies the file contents to the clipboard using macOS pbcopy or Linux xclip/xsel and finally deletes the temp file while reporting the character count.
When to Use It
- You want to share the final answer in Markdown-ready form with colleagues.
- You need to copy the formatted output from a chat session to paste elsewhere.
- You require bold section titles instead of headings and proper Markdown tables.
- You are on macOS or Linux and want clipboard support via pbcopy, xclip, or xsel.
- You want a timestamped formatted artifact of the chat for auditing or reference.
Quick Start
- Step 1: Identify the final answer in this session.
- Step 2: Apply md-copy formatting rules to produce Markdown content.
- Step 3: Write to a timestamped temp file, copy to clipboard, then delete the temp file and read back the character count.
Best Practices
- Review the final answer before formatting to ensure accuracy.
- Ensure all ASCII tables are converted to proper Markdown tables.
- Use bold for section titles and keep no heading elements as required.
- Keep code blocks intact with language tags and preserve lists.
- Verify clipboard availability on the host OS (pbcopy on macOS, xclip or xsel on Linux).
Example Use Cases
- Export a weekly chat summary as Markdown and copy to clipboard for sharing.
- Format troubleshooting steps from a chat and paste into a doc.
- Create a project brief from a planning session and copy to clipboard.
- Convert an FAQ chat into a Markdown document and copy to clipboard.
- Share a formatted chat transcript with teammates by pasting from the clipboard.