← Back to list

slack-to-md
by corca-ai
⭐ 20🍴 4📅 Jan 24, 2026
SKILL.md
name: slack-to-md description: Convert Slack thread URLs to markdown documents. Trigger on "slack-to-md" command or when user provides Slack URLs (https://.slack.com/archives//p*). Also handles updating existing markdown files from their source Slack threads.
Slack to Markdown Converter
Convert Slack thread URLs to well-formatted markdown documents.
Prerequisites
Before using this skill, the following setup is required:
- Node.js 18+: Required for the Slack API script
- Set up Slack Bot: Create a bot at https://api.slack.com/apps with these OAuth scopes:
channels:history- Read messages from public channelschannels:join- Auto-join channels when neededusers:read- Resolve user IDs to names
- Configure token: Copy
.envto.env.localand add your bot token:BOT_TOKEN=xoxb-your-token-here
Workflow
1. Parse Input
Slack URL format: https://{workspace}.slack.com/archives/{channel_id}/p{timestamp}
Extract:
workspace: subdomainchannel_id: after/archives/thread_ts: convertp{digits}→{first10}.{rest}(e.g.,p1234567890123456→1234567890.123456)
Existing .md file: Read and extract Slack URL from > Source: line.
2. Execute Conversion
Run the two scripts in a pipe:
node {SKILL_DIR}/scripts/slack-api.mjs <channel_id> <thread_ts> | \
{SKILL_DIR}/scripts/slack-to-md.sh <channel_id> <thread_ts> <workspace> {PROJECT_ROOT}/slack-outputs/<output_file>.md [title]
{SKILL_DIR}: Shown at the top when skill is invoked as "Base directory for this skill: ..."{PROJECT_ROOT}: Git root or current working directory (use absolute paths for reliability)slack-api.mjs: Fetches thread data from Slack API, outputs JSONslack-to-md.sh: Reads JSON from stdin, generates markdown file
3. Rename to Meaningful Filename
After fetching, read the generated markdown file and extract the first message content. Then rename the file to a meaningful name:
- Read the markdown file to find the first message (after the header)
- Extract a short, descriptive title from the first message (first 30-50 characters, or a key phrase)
- Sanitize the title for use as filename:
- Convert to lowercase
- Replace spaces with hyphens
- Remove special characters (keep only alphanumeric, hyphens, Korean characters)
- Truncate to reasonable length (max 50 chars)
- Rename the file:
mv {old_file}.md {PROJECT_ROOT}/slack-outputs/{sanitized_title}.md - Report the new filename to the user
4. Handle Errors
The slack-api.mjs script automatically handles common errors:
not_in_channel: Automatically joins the channel and retriesmissing_scope: Prints required OAuth scope to stderr
If errors persist, check:
- Bot token is valid in
.env.local - Bot has required OAuth scopes
- Bot is added to the workspace
Resources
- scripts/slack-api.mjs: Slack API wrapper (Node.js 18+, no external deps)
- scripts/slack-to-md.sh: JSON to markdown converter (requires jq, perl)
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon