Format a message for Microsoft Teams and copy it to the clipboard as HTML so Teams renders formatting (bold, headings, code blocks, lists, links, blockquotes) on paste. Use when the user wants to paste a formatted message into Teams. Triggers on "copy to teams", "format for teams", "teams message", "paste to teams", or any request to prepare a rich-formatted message for Microsoft Teams.
Scanned 9/2/2026
Install to Claude Code
npx -y skills add magnusrodseth/dotfiles --skill format-teams-message --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Format Teams Message?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/magnusrodseth-format-teams-message)More formats (shields.io, HTML) on the badges page.
---
name: format-teams-message
description: Format a message for Microsoft Teams and copy it to the clipboard as HTML so Teams renders formatting (bold, headings, code blocks, lists, links, blockquotes) on paste. Use when the user wants to paste a formatted message into Teams. Triggers on "copy to teams", "format for teams", "teams message", "paste to teams", or any request to prepare a rich-formatted message for Microsoft Teams.
---
# Format Teams Message
Draft a message in Magnus's voice, format it as Markdown for Microsoft Teams, and copy it to the macOS clipboard as HTML.
Teams does **not** parse Markdown on paste. Pasting plain Markdown leaves the raw characters (`**`, `>`, `` ` ``, etc.) visible. To get real formatting, HTML must be placed on the macOS clipboard under the `public.html` flavor. Teams reads that flavor on paste and renders it.
## Workflow
1. **Draft the message in Magnus's voice.** Run the content through the `write-in-my-voice` skill so it reads like he wrote it, not like an AI drafted it (see "Composing the message" below). Skip only if the user pasted final text they want verbatim.
2. **Append the AI-disclosure footer** (see "AI-disclosure footer" below) as the last line.
3. Ensure the result is valid Markdown. Adjust if the input has obvious mistakes that would break the HTML conversion.
4. Convert Markdown → HTML using `pandoc`.
5. Place the HTML on the clipboard using `osascript` with the AppKit framework.
6. Confirm the copy and remind the user to paste into Teams.
## Composing the message
Teams messages are outward-facing first-person text, so they go through `write-in-my-voice` (Norwegian or English, register auto-selected). On top of that skill's rules, lean into these for Teams specifically:
- **Smooth, connected sentences.** Favour flowing prose over choppy fragments. Let clauses join with commas, colons, and semicolons (never em dashes) so the message reads naturally start to finish.
- **English for technical jargon.** Keep technical and product terms in English even inside Norwegian prose: say "deployment", "pull request", "merge", "build", "endpoint", "rollback", "feature flag", "background job" rather than forcing a Norwegian equivalent. Magnus code-switches this way naturally; over-translated technical Norwegian reads stiff and wrong.
- **Plain Norwegian for everything else.** Only the technical nouns/verbs switch to English. The connective tissue, framing, and tone stay in natural Norwegian with correct æ/ø/å.
## AI-disclosure footer
Every message this skill composes ends with a short italic disclosure. Match the message language:
- **Norwegian:** `*Denne meldingen er skrevet av AI, korrekturlest av meg, og basert på kontekst jeg har hentet inn selv.*`
- **English:** `*This message was written by AI, proof-read by me, and based on context I gathered myself.*`
**Spacing:** a single blank line is not enough. Teams renders consecutive paragraphs tightly, so the footer crowds the body. Add an explicit empty paragraph above it so there's a real visual gap — a line containing only ` `, or a `---` rule for a stronger footer separator:
```markdown
...last line of the body.
*Denne meldingen er skrevet av AI, korrekturlest av meg, og basert på kontekst jeg har hentet inn selv.*
```
If the user supplied the full message verbatim (workflow step 1 skipped), the "written by AI" framing is inaccurate — ask whether they still want the footer before adding it.
## Implementation
```bash
# 1) Write the voiced message to a temp file (use HEREDOC to preserve formatting).
# End with an empty paragraph ( ) then the italic AI-disclosure footer,
# language-matched to the body. The gives a real gap in Teams.
cat > /tmp/teams-msg.md << 'EOF'
<VOICED MARKDOWN CONTENT GOES HERE>
*Denne meldingen er skrevet av AI, korrekturlest av meg, og basert på kontekst jeg har hentet inn selv.*
EOF
# 2) Convert to HTML. Use --wrap=none to avoid pandoc inserting hard line breaks.
pandoc -f markdown -t html --wrap=none /tmp/teams-msg.md > /tmp/teams-msg.html
# 3) Put HTML on the clipboard via osascript (public.html flavor)
osascript <<'APPLESCRIPT'
use framework "AppKit"
use scripting additions
set theHTML to (do shell script "cat /tmp/teams-msg.html")
set pb to current application's NSPasteboard's generalPasteboard()
pb's clearContents()
pb's setString:theHTML forType:"public.html"
return "Copied to clipboard. HTML length: " & (length of theHTML)
APPLESCRIPT
```
After running, confirm with one line: "Kopiert til Teams-clipboard. Lim inn med Cmd+V."
## What Teams Renders Correctly
| Markdown | HTML pandoc produces | Teams render |
|---|---|---|
| `**bold**` | `<strong>` | bold |
| `*italic*` | `<em>` | italic |
| `~~strike~~` | `<del>` | strikethrough |
| `` `inline code` `` | `<code>` | monospace, grey background |
| ` ``` ` block | `<pre><code>` | code block |
| `# H1` / `## H2` / `### H3` | `<h1>` / `<h2>` / `<h3>` | larger text, bold-ish |
| `> quote` | `<blockquote>` | indented with left bar |
| `- bullet` | `<ul><li>` | bulleted list |
| `1. item` | `<ol><li>` | numbered list |
| `[text](url)` | `<a href>` | clickable link with text |
| Raw URL | text | auto-linked by Teams |
## Known Caveats
- **Tables** (`<table>`) only render in Teams posts/announcements, not in 1:1 or group chat. Convert tables to `key: value` lists or numbered lists if the target is regular chat.
- **Pandoc syntax highlighting** for fenced code blocks with a language hint (e.g. ` ```bash `) produces complex `<span class="...">` markup. Teams strips the classes but generally keeps the text and structure intact. If output looks noisy, add `--no-highlight` to the pandoc call:
```bash
pandoc -f markdown -t html --wrap=none --no-highlight /tmp/teams-msg.md > /tmp/teams-msg.html
```
- **Images** via Markdown (``) do not render. Provide a plain link instead.
- **Horizontal rules** (`---`) become `<hr>` and render as a thin line in Teams (usable).
- **Em dashes** (—) are fine in HTML but the user's house style forbids them. Use commas, parens, colons, semicolons, or separate sentences.
## Pairing With Other Skills
- **`write-in-my-voice`** drafts the message body before formatting (workflow step 1). This skill always pairs with it unless the user supplied verbatim text.
- For pure plain-text drafting (no Teams formatting), use `copy-to-clipboard` instead.
- This skill is the right choice **only** when the destination is Microsoft Teams. For Slack, iMessage, or email, use `copy-to-clipboard`.
## Failure Modes
- If `pandoc` is not installed: tell the user to `brew install pandoc`.
- If `osascript` complains about the framework directive: macOS may have a permissions prompt the first time. Re-run after granting.
- If Teams renders nothing or shows raw HTML tags: the message may have been pasted into a non-rich-text field (e.g. a Teams search box). Confirm the target was the message compose box.
- If special characters break the AppleScript (e.g. unbalanced quotes inside the HTML): the `do shell script "cat ..."` form avoids this because the HTML never passes through AppleScript string parsing. Keep that pattern.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!