Slack Notify
Use this skill only when the user explicitly invokes $slack-notify or explicitly asks to send a Slack notification.
The command posts a plain-text message through slack-post. It loads credentials with the sibling secrets skill, using $secrets slack semantics:
- Token:
SLACK_TOKENorSLACK_BOT_TOKENfrom~/.secrets/.env.slack. - Channel:
SLACK_CHANNELfrom~/.secrets/.env.slack.
Do not print token values, decrypted env values, or full environment dumps.
Usage
./scripts/slack-notify "hello world"
./scripts/slack-notify "task is ready"
The public shorthand is:
$slack-notify "hello world"
$slack-notify "task is ready"
For multi-line text:
printf 'line one\nline two\n' | ./scripts/slack-notify
Workflow
- Confirm the user explicitly asked to post a Slack notification.
- Keep the message plaintext and exactly scoped to what the user requested.
- Run the bundled helper:
./scripts/slack-notify "message"
The helper resolves ../secrets/scripts/secrets, runs secrets slack -- ..., checks SLACK_CHANNEL, and calls:
slack-post --channel "$SLACK_CHANNEL" "message"
slack-post reads the token from SLACK_TOKEN or SLACK_BOT_TOKEN inside the secrets-loaded environment.
Safety
- Do not send Slack posts for generic task completion unless the user explicitly asks for Slack notification.
- Do not echo
SLACK_BOT_TOKEN,SLACK_TOKEN,.env.slack,.env.keys, or dotenvx decrypted output. - If
slack-postfails, report the non-secret error text only. - If credentials are missing, ask the user to update them through
$secrets init slackanddotenvx set ... -f ~/.secrets/.env.slack; do not ask them to paste secret values into chat. - Use
terminal-notifieror other non-Slack notification mechanisms separately when a workspace requires local completion notifications.
Troubleshooting
- Missing
slack-post: install or expose theslack-posttool onPATH. - Missing channel: set
SLACK_CHANNELin~/.secrets/.env.slack. - Missing token: set
SLACK_BOT_TOKENorSLACK_TOKENin~/.secrets/.env.slack. - Missing secrets helper: ensure the
secretsskill is installed beside this skill, or setSECRETS_CMDto the helper path.