Slack audit

From jleechanorg/claude-commands · View interactive version

Slack audit is an AI agent skill from the GitHub repository jleechanorg/claude-commands. Audit Slack channel threads for untracked work items — checks each thread against GH issues/PRs, reports gaps, and optionally redrives dropped threads by posting a status reply to the channel. Slash command: /slack-audit.

How to use this skill

Skill file

/slack-audit

Scan one or more Slack channels for the last N hours, identify threads that contain actionable work items with no corresponding GH issue or PR, and report or redrive them.

Usage

/slack-audit [--channel <#channel|channel_id>] [--hours <N>] [--fix] [--dry-run]

Subagent strategy (mandatory)

Always fan out parallel subagents for independent lookups. Do NOT do GH searches sequentially.

When running --fix: fan out parallel Slack posts (one per dropped thread), do not post sequentially.

Identity: Always post as the authenticated user (the operator, via the MCP Slack tool). Never post as a bot user.

Step-by-step

1. Fetch channel history

Use mcp__slack__conversations_history for the target channel + time window.

mcp__slack__conversations_history(channel_id=<ID>, limit="48h")

Parse the CSV result (headers: MsgID,UserID,UserName,...,Text,Time,...).

Group messages by ThreadTs (empty ThreadTs = root message = its own thread).

2. Extract work items

For each thread, identify messages containing actionable intent signals:

| Signal | Examples |

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

| Imperative verb | "fix", "make", "create", "spawn", "investigate", "drive", "open PR", "file issue" |

| PR/issue reference | github.com/.../pull/N, #7NNN, /green, /es, /er |

| Status question | "what's the status", "is this done", "any update" |

| Explicit work | "AO worker", "dispatch", "bring to green", "/babysit" |

Skip threads that are purely status reports from bots (hermes, coderabbit, etc.) with no human reply.

3. Check GH tracking for each work item

For each extracted work item:

  1. Search gh issue list --repo $GITHUB_REPOSITORY --search "<keywords>" (or agent-orchestrator if relevant)
  2. Search gh pr list --repo $GITHUB_REPOSITORY --search "<keywords>"
  3. Check if the thread itself references a PR/issue number that is still open

Classify each thread:

| Status | Meaning |

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

| TRACKED | Has open or recently merged GH issue/PR |

| COMPLETED | Referenced PR/issue is merged/closed |

| UNTRACKED | No GH issue or PR found |

| NEEDS_REDRIVE | Has issue/PR but no recent activity (>48h stale) |

4. Dry-run report (default)

Print a table:

THREAD                          | STATUS      | GH          | LAST ACTIVITY
--------------------------------|-------------|-------------|---------------
keep-logging-in (Jun 14 00:06)  | TRACKED     | #7576 OPEN  | just filed
collapsible filter (Jun 14 19:29)| TRACKED    | #7203 OPEN  | no PR yet
#684 send_message mis-route     | NEEDS_REDRIVE| #684 OPEN  | 20h stale
wiki-ingest campaign skill      | UNTRACKED   | none        | -
RAG optimize-anything           | UNTRACKED   | none        | -

5. --fix mode: redrive dropped threads

For each UNTRACKED or NEEDS_REDRIVE thread:

  1. Post a reply in the thread summarizing what was found (or not found) and what the next step is.
  2. Post a reply-to-channel so the thread surfaces at the top of the audited channel.

Template for untracked item:

Following up: this thread has no GH issue or PR yet.
[Summary of what was asked]
Next: [proposed action — file issue / spawn worker / close as resolved]

Template for needs-redrive:

Re-driving: issue #N / PR #N has had no activity for >48h.
Current state: [open/CI-red/CR-changes-requested]
Next: [specific action]

Always use the user's identity (the operator, via mcp__slack__conversations_add_message).

Never use bot tokens for these posts.

6. Channels to check by default

Audit every channel ID listed in $SLACK_AUDIT_CHANNELS, in order. A typical

setup lists one channel per work stream, for example:

| Channel | ID | Purpose |

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

| <#product-channel> | <channel-id> | Main product work |

| <#infra-channel> | <channel-id> | Agent infrastructure work |

| <#ao-channel> | <channel-id> | AO worker status |

Existing Hermes scripts (reuse, don't duplicate)

Use the MCP Slack tool (mcp__slack__conversations_history, mcp__slack__conversations_add_message) for in-session posting. Use slack_thread_lib.sh for cron/automation posting.

Integration with /learn

After any --fix run, call /learn to capture:

Notes

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.