Discord Webhook
This skill should be used when the user asks to "send a Discord notification", "notify Discord", "post to Discord", "send a message to Discord webhook", "alert Discord channel", or when another agent, hook, or skill needs to deliver a notification to a Discord channel via webhook. Provides the complete workflow for reading webhook configuration, formatting messages (plain text or Embed), and sending via HTTP POST.
What this skill does
# Discord Webhook Notification
Send messages to Discord channels via webhook HTTP POST. Supports plain text and rich Embed format with multi-webhook routing.
## Overview
Discord webhooks accept JSON payloads via HTTP POST. This skill handles:
1. **Resolve webhook URL** from environment variables or settings file
2. **Format the message** as plain text (`content`) or rich Embed
3. **Send via HTTP POST** using `curl`
## Step 1: Resolve Webhook URL
Before resolving, source the project `.env` file if it exists:
```bash
[ -f .env ] && source .env
```
Then check environment variables:
### 1a: Named Webhook (when a target name is specified)
Look for environment variable `DISCORD_WEBHOOK_{NAME}` where `{NAME}` is the uppercase target name:
```bash
# Examples:
# Target "deploy" → DISCORD_WEBHOOK_DEPLOY
# Target "alerts" → DISCORD_WEBHOOK_ALERTS
```
### 1b: Default Webhook
Look for environment variable `DISCORD_WEBHOOK_URL`.
### Error Handling
If no webhook URL is found, inform the user:
> No Discord webhook URL configured. Add to your `.env` file:
> ```
> DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your/webhook
> ```
> For named targets, use `DISCORD_WEBHOOK_{NAME}` (e.g., `DISCORD_WEBHOOK_DEPLOY`).
Do NOT proceed without a valid webhook URL.
## Step 2: Format the Message
### Plain Text
For simple string messages, use the `content` field:
```json
{
"content": "Deploy v1.2.3 completed successfully"
}
```
`content` has a 2000 character limit. Truncate with `…` if exceeded.
### Embed Format
For structured information (deploy reports, error alerts, build status), use the `embeds` array:
```json
{
"embeds": [{
"title": "Deploy Complete",
"description": "Version **v1.2.3** deployed to production",
"color": 3066993,
"fields": [
{ "name": "Environment", "value": "production", "inline": true },
{ "name": "Duration", "value": "2m 34s", "inline": true }
],
"footer": { "text": "Deployed by Claude Code" },
"timestamp": "2026-04-10T12:00:00.000Z"
}]
}
```
### Format Selection Guidelines
| Scenario | Format | Reason |
|----------|--------|--------|
| Simple status update | Plain text | Short, no structure needed |
| Error alert with details | Embed | Structured fields, color coding |
| Build/deploy report | Embed | Multiple data points |
| Quick notification | Plain text | Minimal overhead |
| Multi-field data | Embed | Fields layout is clearer |
### Common Embed Colors
| Purpose | Color (decimal) | Hex |
|---------|----------------|-----|
| Success | `3066993` | `#2ECC71` |
| Error | `15158332` | `#E74C3C` |
| Warning | `15105570` | `#E67E22` |
| Info | `3447003` | `#3498DB` |
| Default | `9807270` | `#959B86` |
## Step 3: Send the Message
Use `curl` to POST the JSON payload:
```bash
curl -s -o /dev/null -w "%{http_code}" \
-H "Content-Type: application/json" \
-d '{"content":"Hello from Claude Code"}' \
"$WEBHOOK_URL"
```
### Response Handling
| HTTP Status | Meaning | Action |
|-------------|---------|--------|
| `204` | Success (no content) | Message sent successfully |
| `400` | Bad request | Check JSON payload format |
| `401` | Unauthorized | Webhook URL is invalid or revoked |
| `404` | Not found | Webhook has been deleted |
| `429` | Rate limited | Wait and retry (respect `Retry-After` header) |
On success (204), confirm to the caller that the message was sent.
On failure, report the HTTP status code and suggest corrective action.
### Rate Limiting
Discord webhooks have a rate limit of ~30 requests per minute. If sending multiple messages, add a 2-second delay between requests.
## Security Notes
- Never log or echo the full webhook URL — it contains the authentication token
- Store webhook URLs in `.env` (gitignored)
- Sanitize user-provided content before embedding in JSON to prevent injection
- Use `jq -Rs .` to safely escape strings for JSON embedding:
```bash
SAFE_MSG=$(echo "$RAW_MSG" | jq -Rs .)
```
## Tool Selection
- Use **Bash** with `curl` for sending webhook requests (most reliable for JSON payloads)
- Use **Bash** with `jq` for JSON construction with dynamic values
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.