Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
npx skills add raine/skills --skill "copy-to-slack"
Install specific skill from multi-skill repository
# Description
Convert markdown to Slack-ready rich text and copy to clipboard.
# SKILL.md
name: copy-to-slack
description: Convert markdown to Slack-ready rich text and copy to clipboard.
allowed-tools: Bash, Read
Convert a markdown file to rich text and copy it to the clipboard so it can be
pasted into Slack with formatting intact.
Input
The user provides either:
- A file path as
$ARGUMENTS - A file path from recent conversation context
Steps
- Read the markdown file
- Manually convert the markdown to HTML (do NOT use pandoc or any external
tool). Apply these conversions: **bold**β<strong>bold</strong>_italic_/*italic*β<em>italic</em>`code`β<code>code</code>- Fenced code blocks β
<pre><code>...</code></pre> - item/* itemβ<ul><li>item</li></ul>1. itemβ<ol><li>item</li></ol>[text](url)β<a href="url">text</a># Headerβ<strong>Header</strong>(Slack has no native headers)- Paragraph breaks β
<br><br>(Slack ignores<p>margins, so use
<br><br>between paragraphs for visible spacing) - Also prepare a plain-text version (strip markdown syntax)
- Copy to clipboard with both HTML and plain-text representations. Use
>|
instead of>for redirects (zsh has noclobber set). Use this snippet:
html_file=$(mktemp)
plain_file=$(mktemp)
printf '%s' "$html" >| "$html_file"
printf '%s' "$plain" >| "$plain_file"
swift -e "
import AppKit
let html = try! String(contentsOfFile: \"$html_file\", encoding: .utf8)
let plain = try! String(contentsOfFile: \"$plain_file\", encoding: .utf8)
let pb = NSPasteboard.general
pb.clearContents()
pb.setString(html, forType: .html)
pb.setString(plain, forType: .string)
"
rm -f "$html_file" "$plain_file"
- Confirm to the user what was copied
Markdown β Slack formatting mapping
Slack's rich text paste interprets HTML. Key mappings:
**bold**β<strong>β bold in Slack_italic_β<em>β italic in Slack`code`β<code>β inline code in Slack- Code blocks β
<pre><code>β code blocks in Slack - itemβ<ul><li>β bullet lists in Slack[text](url)β<a href>β clickable links in Slack- Headers β bold text (Slack doesn't have native headers)
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.