agentleFS
DanaResearchGroupDanaResearchGroup/agent-skills/slack-ask/SKILL.md

slack-ask

Skill1 starsChanged 3 months agoMITView on GitHub

Ask the user a question over Slack and block until they reply. Use during automated/unattended procedures when you need human input or a decision and the user is away from the terminal.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this when a procedure needs input from the user but they may not be watching the terminal.

    line 8
  2. Very specific:

    Identify context: Run hostname and note the current working directory so the user knows *which machine / which task* is asking.

    line 40
  3. Very specific:

    Call slack_read_thread with channel_id = the $CC_SLACK_CHANNEL id and message_ts = <ts>.

    line 70
  4. Very specific:

    Look for the last message whose user is $CC_SLACK_USER and whose ts is greater than the root ts.

    line 72
  5. Distinctive:

    If found → that text is the answer.

    line 74
  6. Very specific:

    If not found → start the next backgrounded sleep per the table and repeat.

    line 75
  7. Distinctive:

    Keep going at the 30-min cadence until answered, or stop after an overall budget (default ~4 h) and report a timeout to the user.

    line 76
  8. Very specific:

    If the answer is ambiguous, ask a follow-up in the same thread (pass the root ts again) rather than starting a new message.

    line 90
  9. Very specific:

    Never treat your own/bot messages as the answer — filter strictly on user == $CC_SLACK_USER.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

slack-ask — bidirectional human-in-the-loop over Slack

Use this when a procedure needs input from the user but they may not be watching the terminal. You post a question to Slack as a bot, the user replies in the thread, and you read that reply back via the connector and continue. Because you only watch the thread you created, the reply is routed to this CC instance even if other instances on other machines are also asking. (Posting as the bot rather than via the claude.ai connector is why Slack actually notifies — see slack-notify for the full rationale.)

Config

  • Channel: the id in $CC_SLACK_CHANNEL (e.g. C0123456789; find yours in Slack via channel name → About → Copy channel ID). The helper requires it and exits with ERR when unset — wiring in SETUP.md.
  • Send helper: $HOME/.claude/bin/cc-slack-post.py "<message>" [thread_ts] — posts as the bot (reads the bot token from ~/.claude/.slack-bot-token), prints OK then the message ts. It's allowlisted in settings.json, so it runs without a permission prompt (unattended-safe). The command may use $HOME, but the ~/.claude/settings.json allow-rule must use the literal absolute helper path. Thread replies are always broadcast to the channel (reply_broadcast, i.e. "Also send to channel") — the helper sets this automatically. Plain thread replies trigger no Slack alert, so without the broadcast the user never learns a message is pending. Never post a thread reply through any other mechanism (e.g. an MCP send tool) without the equivalent broadcast flag.
  • Human user id: the id in $CC_SLACK_USER (e.g. U0123456789; find yours in Slack under Profile → ⋮ → Copy member ID). Only a reply from that user (not the bot, not yourself) counts as the answer. If $CC_SLACK_USER is unset, stop and say so — the same way the send helper refuses an unset channel. Accepting whoever replies first is not the fallback.

Procedure

  1. Identify context. Run hostname and note the current working directory so the user knows which machine / which task is asking.
  2. Post the question as the bot and capture the thread root ts. Run the helper via Bash (mind shell quoting; the message uses Slack mrkdwn — *bold*, _italic_, `code`, \n for newlines):
    $HOME/.claude/bin/cc-slack-post.py "❓ *<machine>* needs input — \`<task>\`
    <cwd>
    
    <your question, with concrete options if it's a choice>
    
    _Reply in this thread._"
    The first output line is OK; the second line is the thread root ts — keep it, it's your routing key. (If it prints ERR …, report it and stop; common causes: token file missing, or the bot isn't in the channel.)
  3. Wait for a reply (polling loop with backoff). Foreground sleep is blocked in this harness, so wait by running a backgrounded Bash command (sleep <N> with run_in_background: true). When it completes you are re-invoked; then check for the reply. Track elapsed time to pick the interval:

    Elapsed since you postedSleep between polls
    0–5 minsleep 30 (every 30s)
    5–65 minsleep 900 (every 15 min)
    65 min onwardsleep 1800 (every 30 min)

    On each wake:

    • Call slack_read_thread with channel_id = the $CC_SLACK_CHANNEL id and message_ts = <ts>.
    • Look for the last message whose user is $CC_SLACK_USER and whose ts is greater than the root ts.
    • If found → that text is the answer. Go to step 4.
    • If not found → start the next backgrounded sleep per the table and repeat.
    • Keep going at the 30-min cadence until answered, or stop after an overall budget (default ~4 h) and report a timeout to the user.

    Note: background-task completion events are NOT the user's reply — only a slack_read_thread message from $CC_SLACK_USER counts.

  4. Acknowledge and continue. Post a short threaded confirmation by passing the root ts as the second arg, then use the answer to proceed:
    $HOME/.claude/bin/cc-slack-post.py "✅ Got it — continuing." "<ts>"

Notes

  • If the answer is ambiguous, ask a follow-up in the same thread (pass the root ts again) rather than starting a new message.
  • Never treat your own/bot messages as the answer — filter strictly on user == $CC_SLACK_USER.
  • For a one-way notification that needs no reply, use the slack-notify skill.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.