You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(slack-publish): gracefully handle missing SLACK_BOT_TOKEN with setup guidance (#23)
* fix(slack-publish): gracefully handle missing SLACK_BOT_TOKEN with setup guidance
When the bot token is not configured, the publish skill now detects this
early and shows step-by-step setup instructions instead of a bare error.
Adds main() integration tests covering missing-token, missing-file, and
dry-run paths.
Closes#18
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(slack-publish): expand test coverage for main, resolve_channel_id, and load_slack_token edge cases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(slack-publish): extract token check into agent-token-checker agent
Move verify_slackbot_token.py to plugin root scripts/, create
agent-token-checker agent, and update publish skill to invoke the
agent instead of an inline bash snippet. Adds dedicated test file
for verify_slackbot_token (10 tests).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(slack-publish): expand coverage to 75 tests across both test files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(version): bump slack-publish version
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
description: Checks whether SLACK_BOT_TOKEN is available (env var or .env file). Returns exit code 0 if found, 1 if missing. Used by the publish skill before attempting to post to Slack.
4
+
allowed-tools: [Bash]
5
+
model: haiku
6
+
---
7
+
8
+
## Instruction
9
+
10
+
Run the token checker script and report the result:
Copy file name to clipboardExpand all lines: plugins/slack-publish/skills/publish/SKILL.md
+22-6Lines changed: 22 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,29 +16,45 @@ Parse `<markdown-file>` and `<channel>` from `$ARGUMENTS`. Both are required —
16
16
17
17
## Workflow
18
18
19
-
1. Verify the markdown file exists at the given path.
19
+
1.**Check for `SLACK_BOT_TOKEN`** before anything else — use the `slack-publish:agent-token-checker` agent. If it reports "Token missing", **stop here** and show the user this guidance:
20
+
If this exits non-zero, **stop here** and show the user this guidance:
20
21
21
-
2. Run the publisher script, quoting each argument as a discrete shell word to prevent shell injection:
22
+
> **`SLACK_BOT_TOKEN` is not set.** To publish to Slack you need a bot token. Here's how to get one:
23
+
>
24
+
> 1. Go to **https://api.slack.com/apps** and click **Create New App → From a manifest**
25
+
> 2. Select your workspace and paste the contents of `slack-app-manifest.yaml` (in the plugin directory)
26
+
> 3. Click **Install to Workspace** and copy the **Bot User OAuth Token** (starts with `xoxb-`)
27
+
> 4. Invite the bot to your target channel: `/invite @Markdown Publisher`
3. If `SLACK_BOT_TOKEN` is not set in the environment, the script will also check `.env` and `.env.local` in the current directory automatically. To use a different token file:
0 commit comments