Agent skill
slack-work-objects
Create trackable Work Objects in Slack with link unfurling and flexpane details. Use when building agents that need persistent, interactive entities.
Install this agent skill to your Project
npx add-skill https://github.com/rbarazi/agent-skills/tree/main/skills/slack-work-objects
SKILL.md
Slack Work Objects
Create trackable, interactive Work Objects in Slack that persist across conversations.
Problem Statement
Agents often create entities (reports, tasks, documents) that users need to track and interact with later. Work Objects provide persistent, unfurlable links with expandable details panels.
When to Use
- Creating persistent entities users can reference across conversations
- Building links that unfurl with rich previews
- Providing expandable detail panels (flexpane) for entities
- Keywords: work objects, link unfurling, flexpane, slack entities, persistent objects
Quick Start
# MCP tool returns Work Object as resource
WidgetTemplateService.hydrate_for_tool_result(
template: :weatherCurrent,
slack_template: :slackWeatherCurrent,
data: {
location: "Toronto",
workObjectUrl: "https://app.example.com/work-objects/weather/toronto",
externalRefId: "weather-current-toronto-ca"
},
text: "Current weather in Toronto"
)
What Are Work Objects?
- Link Unfurling: Rich previews when URLs are shared
- Flexpane Details: Expanded view when clicked
- Cross-Conversation Tracking: Same entity recognized everywhere
- Actions: Buttons for common operations
Architecture
MCP Tool Result → slack://work-objects/ resource
↓
Message posted with Work Object URLs
↓
Slack triggers link_shared event → App responds with chat.unfurl
↓
User clicks → entity_details_requested → App shows flexpane
Resource Format
{
type: "resource",
resource: {
uri: "slack://work-objects/weather/uuid",
mimeType: "application/vnd.slack.work-object+json",
text: JSON.generate({
event_type: "weather_report",
entity: {
url: "https://app.example.com/work-objects/...",
external_ref: { id: "weather-current-toronto", type: "weather_current" },
entity_type: "slack#/entities/item",
entity_payload: { ... }
}
})
}
}
Testing Strategy
RSpec.describe SlackWorkObjectFormatter do
it "formats entity with required fields" do
result = described_class.format_weather_flexpane(data, weather_type: :current)
expect(result[:entity_type]).to eq("slack#/entities/item")
expect(result[:entity_payload][:attributes]).to be_present
end
end
RSpec.describe "link_shared webhook", type: :request do
it "unfurls work object URLs" do
post "/webhooks/slack", params: link_shared_event
expect(slack_client).to have_received(:chat_unfurl)
end
end
Common Pitfalls
- Stable external_ref IDs: Use location-based, not timestamp-based
- URL must match:
urlandapp_unfurl_urlmust match unfurled URLs - Trigger expiry: Flexpane
trigger_idexpires after 3 seconds - UTF-8 handling: Use
parameterizefor special characters
Reference Files
- entity-format.md - Entity payload structure
- unfurling.md - Handling link_shared events
- flexpane.md - Handling entity_details_requested
- formatter.md - SlackWorkObjectFormatter
- templates.md - YAML Work Object templates
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
test-auth-helpers
Implement authentication testing patterns with RSpec, FactoryBot, and test helpers for Rails applications. Use when writing controller specs, system tests, or request specs that require authenticated users and multi-tenant account context.
multi-tenant-accounts
Implement multi-tenant architecture using an Account model as the tenant boundary. Use when building SaaS applications, team-based apps, or any system where data must be isolated between organizations/accounts.
user-management
Implement user CRUD operations within an account with permission controls and feature flags. Use when building team member management, user administration, or account user settings in multi-tenant Rails applications.
oauth21-provider
Implement an RFC-compliant OAuth 2.1 authorization server in Rails applications. Use when building apps that need to authorize third-party clients (like MCP clients, API consumers, or external integrations) using industry-standard OAuth flows with PKCE, dynamic client registration, and token management.
password-reset-flow
Implement secure password reset with Rails 8's built-in token generation. Use when building "forgot password" functionality with email verification and time-limited reset tokens.
code-pattern-extraction
Extract reusable design and implementation patterns from codebases into Skills. Use when asked to analyze code for patterns, document architectural decisions, create transferrable implementation guides, or extract knowledge into Skills. Transforms working implementations into comprehensive, reusable Skills that can be applied to new projects.
Didn't find tool you were looking for?