Skip to content
This repository was archived by the owner on Aug 9, 2026. It is now read-only.

Repository files navigation

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

mise install
mise run install

Configuration

Non-secret config and any secrets not yet in 1Password live in .env:

cp .env.example .env
# Edit .env with your Slack/LiteLLM credentials and blog config

Secrets stored in 1Password are resolved at runtime by fnox — see fnox.toml. The mise run run and mise run blog tasks invoke commands through fnox exec, which reads secret references from fnox.toml and injects the resolved values as environment variables.

Secrets currently sourced from 1Password (vault AI):

  • LLM_AUTH_TOKEN - LiteLLM key for the blog LLM client
  • WORDPRESS_CLIENT_SECRET - WordPress.com OAuth client secret
  • WORDPRESS_APPLICATION_PASSWORD - WordPress.com application password
  • GITHUB_WORDPRESS_TOKEN - GitHub personal access token (for blog activity)

Slack Assistant additionally requires (via .env):

  • 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 additionally requires (via .env):

  • WORDPRESS_USERNAME - WordPress.com username
  • WORDPRESS_CLIENT_ID - WordPress.com OAuth client ID
  • WORDPRESS_SITE_ID - Target site ID
  • LLM_BASE_URL, LLM_DEFAULT_MODEL - Blog LLM config

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

mise run run
# or directly: fnox exec -- slack run

Running the Blog Publisher

# Full publish with 1Password-backed secrets
mise run blog

# Dry run (no publishing) — pass args through fnox exec
fnox exec -- uv run python -m lsimons_bot.blog --dry-run --verbose

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 basedpyright

# 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

Code of conduct

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages