Skip to content

Slack Bot that automates part of Leo Simons' (lsimons) work at Schuberg Philis

License

Notifications You must be signed in to change notification settings

lsimons/lsimons-bot

lsimons-bot

Python AI bot for Schuberg Philis Slack workspace, automating parts of Leo Simons' work.

Screenshot of lsimons-bot

Features

Slack AI Assistant - Interactive chat via Slack's Assistant API, powered by LLM through LiteLLM proxy. Maintains thread context, shows thinking status, suggests follow-up prompts.

Blog Automation - Monitors GitHub activity, generates blog posts summarizing significant commits, publishes to WordPress.com. Runs as scheduled CLI command.

Architecture

lsimons_bot/
├── app/           # Bootstrap (main.py, config.py)
├── bot/           # Bot abstraction with system prompt
├── llm/           # AsyncOpenAI client for LiteLLM proxy
├── slack/         # Slack integration layer
│   ├── assistant/ # AI Assistant API handlers
│   ├── home/      # Home tab handlers
│   └── messages/  # Message event handlers
└── blog/          # Blog automation module
    ├── github.py  # GitHub commit fetching
    ├── wordpress.py # WordPress.com API client
    ├── content.py # LLM-based content generation
    └── publish.py # Orchestration logic

Setup

Dependencies

uv python install
uv venv
source .venv/bin/activate
uv sync --all-groups

Environment Variables

cp .env.example .env
# Edit .env with your credentials

Slack Assistant requires:

  • SLACK_BOT_TOKEN - Bot OAuth token
  • SLACK_APP_TOKEN - App-level token for socket mode
  • LITELLM_API_BASE - LiteLLM proxy URL
  • LITELLM_API_KEY - LiteLLM API key
  • ASSISTANT_MODEL - Model name (e.g., gpt-4)

Blog Module requires:

  • WORDPRESS_USERNAME, WORDPRESS_APPLICATION_PASSWORD - WordPress.com credentials
  • WORDPRESS_CLIENT_ID, WORDPRESS_CLIENT_SECRET - OAuth app credentials
  • WORDPRESS_SITE_ID - Target site ID
  • GITHUB_TOKEN - GitHub personal access token
  • LLM configuration via lsimons-llm environment variables

Slack App Configuration

slack help
slack app settings  # Opens web settings

The manifest.json contains initial config; ongoing changes via web settings.

Usage

Running the Slack Bot

uv run --env-file .env ./app.py

Running the Blog Publisher

# Dry run (no publishing)
python -m lsimons_bot.blog --dry-run --verbose

# Publish if significant activity
python -m lsimons_bot.blog

Blog publishes when: >24 hours since last post AND (>5 commits OR any commit >200 lines changed).

Development

See AGENTS.md for development guidelines.

Formatting, Linting, Tests

# Format
uv run ruff format .

# Lint
uv run ruff check .
uv run pyright

# Test
uv run pytest

# Test with coverage
uv run pytest --cov=lsimons_bot

Documentation

Specs

Slack API References

License

MIT. See LICENSE.md.

About

Slack Bot that automates part of Leo Simons' (lsimons) work at Schuberg Philis

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages