feat: Add ComfyPR Bot with Slack/Notion integration and fix event handling #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ComfyPR Bot system with comprehensive Slack and Notion integration skills, plus critical bug fixes for Slack WebSocket event handling.
Bot Skills Implementation
Created a full-featured bot skills system with CLI tools for Slack and Notion integration:
Slack Skills (
bot/slack/).spec.tsfiles (16 tests passing)Notion Skills (
bot/)Documentation
Bug Fixes
Fix 1: App Mention Event Schema Mismatch
Problem: Bot was rejecting valid
app_mentioneventsRoot Cause:
client_msg_idwas required but Slack doesn't always include it (e.g., retry attempts)attachmentsfield was missing from schema (needed for message unfurls)Solution:
client_msg_idoptional in Zod schemaattachmentsfield as optional arrayFix 2: WebSocket System Messages Not Handled
Problem: Normal Slack protocol messages logged as
MSG_NOT_MATCHEDRoot Cause:
app_mentioneventsSolution:
Testing
All skills have comprehensive test coverage:
Manual verification:
bot/msg.logSecurity Review
.gitignore(already has*.log)Files Changed
New Files:
bot/index.ts- Main bot implementationbot/README.md- Skills documentationbot/BUGFIX.md- Bug fix documentationbot/notion-search.ts- Notion search skillbot/slack/msg-update.ts- Slack message update skillbot/slack/msg-read-thread.ts- Slack thread reader skillbot/slack/parseSlackMessageToMarkdown.ts- Slack to Markdown converterbot/slack/slackTsToISO.ts- Timestamp converterbot/slack/*.spec.ts- Test filesbot/Dockerfile- Bot container configurationbot/IdleWaiter.ts- Utility for idle detectionModified Files:
CLAUDE.md- Added ComfyPR Bot Skills documentation sectionContext Repositories
The bot has knowledge of these Comfy-Org repositories:
Next Steps
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]