Write Message

From opencodos/opencodos · View interactive version

Write Message is an AI agent skill from the GitHub repository opencodos/opencodos. Quick send a message via Telegram, Slack, or Email. Use for fast, direct messages.

How to use this skill

Skill file

Write Message

Quick send a message via Telegram, Slack, or Email. Fast, direct, matches user's voice.

For polished/thoughtful messages, use /draft instead.

Trigger

/msg [contact] [message]

Examples:

Execution Flow

1. Parse → 2. Ask Channel → 3. Find Contact → 4. Fetch Context → 5. Apply Style → 6. Confirm → 7. Send

Step 1: Parse Input

Extract:

Step 2: Ask Channel

Always ask user:

Send via:
1. Telegram (recommended)
2. Slack
3. Email

Step 3: Find Contact

Use channel's MCP tools:

| Channel | Tool | Status |

|---------|------|--------|

| Telegram | search_contacts, resolve_username | Ready |

| Slack | slack_search_users | Ready (Official Slack MCP) |

| Email | search_contacts | Placeholder |

Step 4: Fetch Context

Before drafting, understand the conversation state.

  1. Check vault for history:
  1. If Telegram MCP available:
  1. If no history found:
  1. Shape message based on context:

Step 5: Apply Style

Detect language from contact name, then apply user's voice.

Step 6: Confirm

To: [Contact Name]
Via: [Channel]
Message: [Draft]

Send? (yes/no)

Skip confirmation only if user said "send" or "tell them" explicitly.

Step 7: Send

Telegram:

Run directly via Bash (no MCP needed):

python3 "$CODOS_PATH/scripts/send-telegram.py" \
  --chat "[chat_name_or_id]" \
  --message "[message]"

For files:

python3 "$CODOS_PATH/scripts/send-telegram.py" \
  --chat "[chat_name_or_id]" \
  --message "[caption]" \
  --file "/path/to/file"

Slack: Use slack_send_message tool directly (Official Slack MCP)

Email: Use Gmail MCP gmail_send tool with recipient, subject, body


Channel Tools

Telegram (Ready — Direct Script)

| Action | How |

|--------|-----|

| Send message | python3 scripts/send-telegram.py --chat "Name" --message "text" |

| Send file | python3 scripts/send-telegram.py --chat "Name" --message "caption" --file /path |

| Search contacts | Script resolves by name substring automatically |

Slack (Ready — Official Slack MCP)

| Action | How |

|--------|-----|

| Send message | Use slack_send_message tool with channel and text |

| Search users | Use slack_search_users tool with query |

| Search channels | Use slack_search_channels tool with query |

| Read messages | Use slack_read_channel tool with channel ID |

Email (Ready — Official Gmail MCP)

| Action | How |

|--------|-----|

| Send email | Use gmail_send tool with recipient, subject, body |

| Search emails | Use gmail_search tool with query |

| Create draft | Use gmail_create_draft tool with recipient, subject, body |


Messaging Style

General Rules

Russian

Greeting: Привет!

Patterns:

давай созвонимся [когда]?
давай / ок / отправил!
наберемся в ближайшее время?
Вот [что]. Дай знать если захочешь обсудить.

Real examples:

Привет, завтра утром твоим давай созвонимся?
Отправил!
давай
Давай в 10 по Лондону - отправлю ссылку.

English

Greeting: hey or skip

Patterns:

how about [time]? I'm in [location] - can speak until [time]
sure / sounds good / works
5 min / on it

Real examples:

how about 10-11a Lisbon? I'm in Asia - can speak until 4p your time
Sure
5 min

Language Detection

| Contact Type | Language |

|--------------|----------|

| Cyrillic name | Russian |

| English name | English |

| Unsure | Ask user |

Known Russian Contacts

Detect from CRM contacts with Cyrillic names.

Known English Contacts

Detect from CRM contacts with Latin names.


Error Handling

| Issue | Action |

|-------|--------|

| Contact not found | Ask user to clarify |

| Multiple matches | Show options |

| Telegram send fails | Check session string at ~/.codos/config/telegram/session.string |

| Channel not ready | "Slack/Email MCP not configured yet" |


Execution Notes

Never use background mode for send operations. Run MCP sends directly with a longer timeout (120s). Background mode can cause duplicate sends if you retry before the first task completes.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.