- Composition root
src/index.ts- Loads env/config, initializes store/runtime, registers handlers, starts Slack app.
- Slack interface layer
src/slack/handlers/todo-command.tssrc/slack/handlers/todo-actions.tssrc/slack/handlers/todo-views.tssrc/slack/handlers/todo-shortcuts.ts- Handles Slack payloads and responses.
- Runtime/application service layer
src/slack/runtime.ts- Shared operational behavior used by handlers (post, sync, notify, settings modal open).
- Domain helpers/parsers
src/slack/assignee-resolver.tssrc/tasks/input-parser.tssrc/tasks/id-helpers.tssrc/app/todo-behavior.ts
- Persistence + model
src/store.tssrc/types.ts
- UI composition
src/blocks.ts- Block Kit builders for cards, boards, and modals.
- Keeps Slack transport details away from persistence logic.
- Keeps shared behavior centralized in one runtime service.
- Allows feature growth by adding focused modules instead of growing a single monolith file.
- Add new slash subcommands in
todo-command.ts. - Keep reusable logic in
runtime.tsor dedicated helper/service modules. - Keep Slack block composition in
blocks.ts. - Keep DB access in
store.tsonly. - Extend
types.tsfirst when adding new domain fields.
For repeating tasks/reminders, introduce application services under src/tasks/services/ and migrate task lifecycle rules out of handlers.