diff --git a/plugins/compound-engineering/README.md b/plugins/compound-engineering/README.md index d58de27..f783bcc 100644 --- a/plugins/compound-engineering/README.md +++ b/plugins/compound-engineering/README.md @@ -24,7 +24,12 @@ The primary entry points for engineering work, invoked as slash commands: | `/ce:work` | Execute work items systematically | | `/ce:compound` | Document solved problems to compound team knowledge | | `/ce:compound-refresh` | Refresh stale or drifting learnings and decide whether to keep, update, replace, or archive them | +### Research & Context + +| Skill | Description | +|-------|-------------| | `/ce-sessions` | Ask questions about session history across Claude Code, Codex, and Cursor | +| `/ce-slack-research` | Search Slack for interpreted organizational context -- decisions, constraints, and discussion arcs | ### Git Workflow diff --git a/plugins/compound-engineering/agents/research/slack-researcher.md b/plugins/compound-engineering/agents/research/slack-researcher.md index adbb010..1db581e 100644 --- a/plugins/compound-engineering/agents/research/slack-researcher.md +++ b/plugins/compound-engineering/agents/research/slack-researcher.md @@ -1,7 +1,7 @@ --- name: slack-researcher description: "Searches Slack for organizational context relevant to the current task -- decisions, constraints, and discussions that may not be documented elsewhere. Use when the user explicitly asks to search Slack for context during ideation, planning, or brainstorming. Always surfaces the workspace identity so the user can verify the correct Slack instance was searched." -model: inherit +model: sonnet --- **Note: The current year is 2026.** Use this when assessing the recency of Slack discussions. @@ -23,13 +23,21 @@ Slack conversations carry organizational knowledge in their structure, not just ### Step 1: Precondition Checks +This agent depends on a Slack MCP server. Verify availability before doing any work: + +1. Search for Slack tools using the platform's tool discovery mechanism (e.g., ToolSearch in Claude Code, tool listing, or schema inspection). Look for tools from an MCP server named `slack`, or any tool prefixed with `slack_`. +2. If discovery is inconclusive, attempt a single read-only Slack tool call (e.g., `slack_search_public`) as a probe. +3. If Slack tools are not found through discovery, or the probe returns a tool-not-found / transport / auth error, return the following message and stop: + +"Slack research unavailable: Slack MCP server not connected. Install and authenticate the Slack plugin to enable organizational context search." + +Do not attempt the rest of the workflow. Do not use non-Slack tools as alternatives. + If the caller provided no topic or search context, return immediately: "No search context provided -- skipping Slack research." -Verify Slack MCP connectivity by attempting to use `slack_search_public` with a minimal test query. If the tool call fails or no Slack tools are available, return the following message and stop: - -"Slack research unavailable: Slack MCP server not connected. Install and authenticate the Slack plugin to enable organizational context search." +The caller's prompt may be a structured research dispatch or a freeform question. Extract the core search topic from whatever form the input takes before proceeding to Step 2. ### Step 2: Search @@ -39,11 +47,14 @@ Formulate targeted searches using `slack_search_public_and_private`. Start with - Location: `in:channel-name`, `-in:channel-name` - Author: `from:username`, `from:<@U123456>` -- Content type: `is:thread` (threaded discussions), `has:pin` (pinned decisions/announcements), `has:link` -- Date: `after:YYYY-MM-DD`, `before:YYYY-MM-DD`, `during:month` +- Content type: `is:thread` (threaded discussions), `has:pin` (pinned decisions/announcements), `has:link`, `has:file` (messages with attachments) +- Reactions: `has::emoji:` (e.g., `has::white_check_mark:`) -- useful for finding approved or decided items +- Date: `after:YYYY-MM-DD`, `before:YYYY-MM-DD`, `on:YYYY-MM-DD`, `during:month` - Text: `"exact phrase"`, `-word` (exclude), `wild*` (min 3 chars before `*`) - Boolean operators (`AND`, `OR`, `NOT`) and parentheses do **not** work in Slack search. Use spaces for implicit AND and `-` for exclusion. +For topics where shared documents may contain decisions (e.g., strategy, roadmaps), supplement message search with `content_types="files"` to surface attached PDFs, spreadsheets, or documents. + If the caller provides prior Slack findings (e.g., from an earlier brainstorm), review them first and focus searches on gaps -- implementation-specific context, technical decisions, or dimensions not already covered. Do not re-research what is already known. Search public and private channels (set `channel_types` to `"public_channel,private_channel"` -- do not search DMs). The user has already authenticated the Slack MCP. @@ -112,7 +123,6 @@ Conversations are informal. People express things in Slack threads they would no ## Tool Guidance -- Use Slack MCP tools only (`slack_search_public_and_private`, `slack_read_thread`, `slack_read_channel`). -- Do not use shell commands. +- Use Slack MCP tools only (`slack_search_public_and_private`, `slack_read_thread`, `slack_read_channel`). If a Slack tool call fails mid-workflow (auth expiry, transport error, renamed tool), report the failure and stop. Do not substitute non-Slack tools. - Do not write to Slack -- no sending messages, creating canvases, or any write actions. - Process and summarize data directly. Do not pass raw message dumps to callers. diff --git a/plugins/compound-engineering/skills/ce-slack-research/SKILL.md b/plugins/compound-engineering/skills/ce-slack-research/SKILL.md new file mode 100644 index 0000000..7fc7cfa --- /dev/null +++ b/plugins/compound-engineering/skills/ce-slack-research/SKILL.md @@ -0,0 +1,41 @@ +--- +name: ce-slack-research +description: "Search Slack for interpreted organizational context -- decisions, constraints, and discussion arcs that shape the current task. Produces a research digest with cross-cutting analysis and research-value assessment, not raw message lists. Use when searching Slack for context during planning, brainstorming, or any task where organizational knowledge matters. Trigger phrases: 'search slack for', 'what did we discuss about', 'slack context for', 'organizational context about', 'what does the team think about', 'any slack discussions on'. Differs from slack:find-discussions which returns individual message results without synthesis." +--- + +# /ce-slack-research + +Search Slack for organizational context and receive an interpreted research digest. + +## Usage + +``` +/ce-slack-research [topic or question] +/ce-slack-research +``` + +## Examples + +``` +/ce-slack-research free trial +/ce-slack-research What did we say about free trial recently? +/ce-slack-research free trial in #proj-reverse-trial +/ce-slack-research onboarding flow after:2026-03-01 +``` + +The input can be a keyword, a natural language question, or include Slack search modifiers like channel hints (`in:#channel`) and date filters (`after:YYYY-MM-DD`). The agent extracts the topic and formulates searches from whatever form the input takes. + +## Execution + +If no argument is provided, ask what topic to research. Use the platform's blocking question tool (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, ask in plain text and wait for a reply. + +Dispatch `compound-engineering:research:slack-researcher` with the user's topic as the task prompt. Omit the `mode` parameter so the user's configured permission settings apply. + +The agent handles everything from here -- Slack MCP discovery, search execution, thread reads, and synthesis. It returns a digest with: + +- **Workspace identifier** so the user can verify the correct Slack instance was searched +- **Research-value assessment** (high / moderate / low / none) with justification +- **Findings organized by topic** with source channels and dates +- **Cross-cutting analysis** surfacing patterns across findings + +If the agent reports that Slack is unavailable (MCP not connected or auth expired), relay the message to the user. Do not attempt alternative research methods.