Setup Slack Signals
Fetch Slack workspace data and extract per-person engagement signals for team analytics
Check if Slack is connected. If not, help the user connect via the Slack workspace
discovery skill. Once connected, proceed with the fetch.
Tell the user: "Fetching Slack engagement data... This takes about 30 seconds."
Verify the fetch succeeded by checking that Manager Slack Raw Data exists
and contains thisWeek and lastWeek message arrays. If the file is missing or empty,
tell the user the fetch failed and stop.
Read Manager Slack Raw Data and aggregate per-person engagement signals.
For each unique user in the message data, calculate:
- Message count this week
- Message count last week
- Frequency delta as percentage: ((thisWeek - lastWeek) / lastWeek) * 100
- After-hours message percentage (messages where isAfterHours is true)
- Weekend message count (messages where isWeekend is true)
- Channel count (distinct channels they posted in)
Also calculate team averages:
- Average messages per person
- Average after-hours percentage
- Average channel count
Handle edge cases:
- If a person has 0 messages last week, frequency delta is "new" not infinity
- Skip bot users or system messages
- Note users with very few messages (< 5) as "low activity"
Write the aggregated signals to Team Engagement Signals (session file for this analysis).
Format:
{
"fetchedAt": "[current ISO timestamp]",
"workspace": "[from raw data]",
"period": "[from raw data period field]",
"teamSignals": [
{
"name": "[user name]",
"thisWeekMessages": [count],
"lastWeekMessages": [count],
"frequencyDelta": [percent or "new"],
"afterHoursPercent": [percent],
"weekendMessages": [count],
"channelCount": [count]
}
],
"teamAverages": {
"avgMessages": [number],
"avgAfterHoursPercent": [number],
"avgChannelCount": [number]
}
}Sort teamSignals by name for consistent ordering.
For team members with significant activity (10+ messages), update their entity profiles.
For each person, run Resolve Person Entity with:
- name: their display name
- source: "Slack: Team analytics"
- relationship context: "Direct report" or "Team member" based on existing knowledge
- Add engagement signals as metadata (frequency delta, after-hours %)
The resolver handles merging with existing profiles.
Report to the user:
"✓ Slack signals cached for [N] team members.
Period: [date range]
Signals available: message frequency, after-hours activity, weekend work, channel breadth"
Note any limitations observed (e.g., "Only seeing [N] channels - signals reflect
visible workspace activity").
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. Check if Slack is connected. If not, help the user connect via the Slack workspace
discovery skill. Once connected, proceed with the fetch.
Tell the user: "Fetching Slack engagement data... This takes about 30 seconds."
2. [Gather Arguments: Fetch Workspace Messages] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `outputPath`: session/manager-slack-raw.json
- `daysBack` (default: "14"): 14
3. [Run Code: Fetch Workspace Messages]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/sentiment.slack.fetch/preview,
"args": [
"outputPath",
"daysBack"
]
},
"packages": null
}
```
4. Verify the fetch succeeded by checking that `session/manager-slack-raw.json` exists
and contains thisWeek and lastWeek message arrays. If the file is missing or empty,
tell the user the fetch failed and stop.
5. [Read Slack Engagement Signals]: Read the documentation in: `skills/sauna/[skill_id]/references/manager.slack.signals.md` (Reference for signal extraction and cache format)
6. Read `session/manager-slack-raw.json` and aggregate per-person engagement signals.
**For each unique user in the message data, calculate:**
1. Message count this week
2. Message count last week
3. Frequency delta as percentage: ((thisWeek - lastWeek) / lastWeek) * 100
4. After-hours message percentage (messages where isAfterHours is true)
5. Weekend message count (messages where isWeekend is true)
6. Channel count (distinct channels they posted in)
**Also calculate team averages:**
- Average messages per person
- Average after-hours percentage
- Average channel count
Handle edge cases:
- If a person has 0 messages last week, frequency delta is "new" not infinity
- Skip bot users or system messages
- Note users with very few messages (< 5) as "low activity"
7. [Read People Directory]: Discover relevant information in the user's filesystem at `documents/knowledge/people/*.md`. (Check existing team member profiles to merge with)
8. Write the aggregated signals to `documents/manager/signals.json` (session file for this analysis).
Format:
```json
{
"fetchedAt": "[current ISO timestamp]",
"workspace": "[from raw data]",
"period": "[from raw data period field]",
"teamSignals": [
{
"name": "[user name]",
"thisWeekMessages": [count],
"lastWeekMessages": [count],
"frequencyDelta": [percent or "new"],
"afterHoursPercent": [percent],
"weekendMessages": [count],
"channelCount": [count]
}
],
"teamAverages": {
"avgMessages": [number],
"avgAfterHoursPercent": [number],
"avgChannelCount": [number]
}
}
```
Sort teamSignals by name for consistent ordering.
9. For team members with significant activity (10+ messages), update their entity profiles.
For each person, run `skills/sauna/[skill_id]/references/recipes/context.entity.resolve_person.md` with:
- name: their display name
- source: "Slack: Team analytics"
- relationship context: "Direct report" or "Team member" based on existing knowledge
- Add engagement signals as metadata (frequency delta, after-hours %)
The resolver handles merging with existing profiles.
10. Report to the user:
"✓ Slack signals cached for [N] team members.
Period: [date range]
Signals available: message frequency, after-hours activity, weekend work, channel breadth"
Note any limitations observed (e.g., "Only seeing [N] channels - signals reflect
visible workspace activity").